Skip to main content
Filter by
Sorted by
Tagged with
5 votes
1 answer
98 views

In Frege how can I convert an String safely to a Maybe Int?

In Frege I want to convert an String to an Int, but need to handle unparsable strings too. So I guess I'm looking for something like a readMaybe function. Where do I find this? Or how can I use Java's ...
halloleo's user avatar
  • 10.1k
0 votes
0 answers
57 views

Does Frege transpiles directly to Java source code?

I am thinking of using Frege in a Java project. I need that the compiler generates plain Java source files, not class files. -- I looked at the Frege wiki, but could not determine whether this is the ...
halloleo's user avatar
  • 10.1k
1 vote
1 answer
60 views

“Return type is incompatible” / Bad native declaration module error on applicative instance

I’m reading the book "Haskell Programming from first principles" by Christopher Allen and Julie Moronuki and try to implement the code and examples in Frege. Unfortunately, I run into compile errors ...
Damian's user avatar
  • 13
1 vote
1 answer
48 views

What is the motivation behind the "let definition is a constant" hint?

With -hints option on, the compiler emits a hint message against the following program: module Main where main :: IO () main = do let magic :: Int -- (A) magic = 123 println magic ....
Ohashi's user avatar
  • 396
1 vote
2 answers
83 views

Why does Foldable inherit from Functor in Frege?

In Haskell, the class Foldable is standalone i.e. class Foldable t where ... However, in Frege: class Functor t => Foldable t where ... Why was this constraint introduced? What ill-formed ...
Ohashi's user avatar
  • 396
2 votes
1 answer
157 views

How to evaluate/run frege IO () monad from java?

First of all sorry for my English, and for the fact that I'm trying to learn Haskell I would run Frege code (Haskell) calling from java, for almost all aspects I managed to make it all work as per ...
Dario Gerosa's user avatar
2 votes
1 answer
60 views

How can I create a new ViewPager in froid

I'm using froid to write Android applications and I can't seem to find documentation on how to make a ViewPager. How do I go about making a custom one?
user3574294's user avatar
1 vote
1 answer
94 views

How to define multiple patterns in Frege?

I'm having some trouble defining a function in Frege that uses multiple patterns. Basically, I'm defining a mapping by iterating through a list of tuples. I've simplified it down to the following: ...
JJ Brown's user avatar
  • 571
1 vote
0 answers
79 views

Compiling other JVM languages in Android Studio

I'm trying to write Android applications in Frege and I currently have the gradle compiling the project after evaluation like this: project.afterEvaluate { extensions.compileFrege = { ...
user3574294's user avatar
2 votes
1 answer
179 views

Writing an Android app purely in Frege

I've been looking into this for a while now but there seems to be old solutions that focus on mainly calling frege from Java. Is there a way to write an complete app/Activity purely in Frege? If not, ...
user3574294's user avatar
2 votes
1 answer
34 views

Type not as polymorphic as suggested

I'm trying to make a Functor instance for the following data type: data Event t a = Event { runEvent :: t -> ([a], Event t a) } instance Functor (Event t) where fmap :: (a -> b) -> ...
Michael Chav's user avatar
5 votes
1 answer
267 views

Haskell/Frege <=< and =<< associativity

According to Hoogle, the fixity of <=< (Kleisli monad composition, or "left fish") and =<< (reverse monad bind) is infixr 1. If I'm looking at them correctly, an expression like, say ...
Mona the Monad's user avatar
1 vote
1 answer
63 views

Searching for existing Frege java native bindings such as java.nio.file.Path

I am trying to port a simple java project over to Frege for practice. I spent a bit of time looking for bindings for java.nio.file.Path, among other things. I found https://github.com/Frege/frege/...
Justin Thomas's user avatar
1 vote
1 answer
70 views

How can I get the Frege compiler to see Android API classes when using Gradle?

I am attempting to write an Android app using the Frege language. Unfortunately, I'm not aware of any examples of how to do this. So, I'm using Gradle as my build system, with the Android Gradle ...
user31708's user avatar
  • 720
1 vote
2 answers
584 views

Frege trace not printing

As the title says, for some reason, messages passed to the trace (well, a variant of which) function don't show up properly when debugging functions. Simply flushing stdout/stderr doesn't seem to do ...
Mona the Monad's user avatar

15 30 50 per page
1
2 3 4 5
8