108
questions
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 ...
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 ...
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 ...
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
....
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 ...
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 ...
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?
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:
...
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 = {
...
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, ...
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) -> ...
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
...
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/...
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 ...
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 ...