Coder Social home page Coder Social logo

frege / frege Goto Github PK

View Code? Open in Web Editor NEW
3.6K 3.6K 144.0 101.95 MB

Frege is a Haskell for the JVM. It brings purely functional programing to the Java platform.

Home Page: https://github.com/Frege/frege/wiki/_pages

License: Other

Makefile 0.22% Frege 67.83% Java 29.78% HTML 0.02% Perl 0.78% Batchfile 0.01% Yacc 1.32% Shell 0.03% Forth 0.01%

frege's People

Contributors

catull avatar dierk avatar earldouglas avatar gitter-badger avatar homeworkprod avatar ingo60 avatar joneshf avatar josephcsible avatar jsoref avatar kfish avatar kinow avatar lglo avatar matil019 avatar mmhelloworld avatar mperry avatar pkapustin avatar ppelleti avatar seancorfield avatar talios avatar tkawachi avatar tommay avatar vijaykiran avatar vsts avatar y-taka-23 avatar yoeight avatar yuxuanchiadm avatar zjhmale avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frege's Issues

Mobile app support?

Can we get a demo Android app?

Is it possible to write iOS apps in Frege using a bridge like j2objc?

Is it possible to write Windows RT apps?

Data constructors cannot be made protected

Data constructors cannot be made protected (only public and private).
This, however, is useful for similar modules like Map and Set.
Especially functions like Map.fromSet and Map.keysSet would need this feature.
Of course workarounds are possible, but I think this feature can be of greater good :)

Ord instance is difficult to use

Ord instance is difficult to use. I'd like having something like this:

data Foo a = Foo { word :: String, pos :: Int, annotation :: a}

instance Eq (Foo a) where
    v == w = v <=> w == Eq
    hashCode f = hashCode f.word + hashCode f.pos
instance Ord (Foo a) where
    (<=>) = comparing (\f -> (f.pos, f.word))

However, this doesn't compile, becaused of multiple errors:

  • can't find a type for f.pos pos is neither an overloaded function nor a member of Foo t73798
  • inferred type is more constrained than expected type inferred: (Ord (t73807,t73808),Ord t73807,Ord t73808,Ord t73807,Ord t73808) => Foo t73798 -> Foo t73798 -> Ordering expected: Foo t73798 -> Foo t73798 -> Ordering
  • can't find a type for f.pos pos is neither an overloaded function nor a member of Foo t3077
  • can't find a type for f.word word is neither an overloaded function nor a member of Foo t3077
  • can't find a type for f.word word is neither an overloaded function nor a member of Foo t73798

Instead, I have to use the cumbersome function:

instance Ord (Foo a) where
  v <=> w = 
    let c1 = compare v.pos w.pos in
    if c1 /= Eq 
    then c1 
    else compare v.word w.word

Pattern support

Frege should support negative patterns, like Haskell 2010, see section 3.17.1
In addition, since product pattern match has been made stricter by default recently, the language reference is currently lying regarding this point. We could take this as an opportunity to implement ~patterns that would work extremely lazy, like product patterns previously. (i.e. submatches would all be in a closure.

Record-field-names are not available in lambda-expressions

Record field names are not available in lambda-expressions, even though the type is correctly inferred.

module Test where

data Foo = Foo { bar :: Int }

good :: Foo -> Int
good = (\f -> f.bar) -- this works

bad :: Foo -> Int
bad = id (\f -> f.bar) -- error in this line

can't find a type for f.bar bar is neither an overloaded function nor a member of Foo

I assume good works because the lambda-expression is not passed as an argument.

Type-error-messages have complex type-variables

The type-checker infers types like t4711 even if there is just a single polymorphic type.
Perhaps it is better to post-process the message in order to get rid of the complex type-variables and to introduce simpler ones like a, b, c ...

is:

inferred type is more constrained than expected type inferred: (Ord (t73807,t73808),Ord t73807,Ord t73808,Ord t73807,Ord t73808) => Foo t73798 -> Foo t73798 -> Ordering expected: Foo t73798 -> Foo t73798 -> Ordering

suggestion:

inferred type is more constrained than expected type inferred: (Ord (a,b),Ord a,Ord b,Ord a,Ord b) => Foo c -> Foo c -> Ordering expected: Foo c -> Foo c -> Ordering

Nice Frege Logo

The current "logo" is just two letters on a white background.
It would be nice to come up with something more appealing.

Parallelism?

I'm looking for JVM languages that support parallelism. Scala does, but its syntax is horribly inconsistent and confusing, it's like C++ all over again. Frege appears to have much more consistent syntax, but it doesn't appear to support parallel processing in the way that Haskell and Scala support parallel processing.

newtypes not ptoperly supported in native types

Consider:

data STData s a = Mut a

data Date = pure native java.util.Date where
    native new :: () -> MutIO Date                          -- bad code  
    native show toString :: STData s Date -> ST s String    -- code gen complains

The new method runs new java.lang.Object(), should be new java.util.Date()

The show method gets complaint: Cannot invoke instance method toString on non native type

Invalid java code generated for instances of sub classes, logical errors in instance contexts not diagnosed

What steps will reproduce the problem?

  1. Declare a 'Base' typeclass
  2. Declare a 'Sub' typeclass that needs a Base type constraint
  3. Implement a instance of both Base and Sub type class

What is the expected output? What do you see instead?

The code should compile

Please use labels and text to provide additional information.

On the attached bug.fr file:

if you change the type constraint list order to '(Sub m, RandomTypeClass w)', the code compiles.

Whatever the type constraint list order, if you implement Base typeclass function(s) directly in Sub implementation, the code compiles

module Bug where

data Algebric w m a = Algebric m a

class Base t where
  base :: t a

class Sub Base t => t where
  sub :: t a

class RandomTypeClass t where
  foo :: t

instance Base Base m => (Algebric w m) where
  base = error "todo"

instance Sub (RandomTypeClass w, Sub m) => (Algebric w m) where
  sub  = error "todo"

Regards,

Yorick

Better support for calling frege from java

Objective

Given a symbol table (either created through compilation or reconstructed from class-Files) and a set of function and variable names, it should be possible to derive a Java class with the following properties:

  • For each given name N, the class contains a method that returns the evaluated and possibly un-boxed value of a fully satisfied function call or just the value in case N is not a function.
  • The arguments to the methods are also values, even if the frege function is lazy in the corresponding argument.
  • Native values are passed as such (int, String, you name it).
  • Maybe conversion will be done for arguments and return values.

The support will remain limited, however. For, suppose we have

tuple :: a -> b -.> (a,b)
tuple a b = (a,b)

we must insist on getting java.rt.FV (frege values) as arguments. This is because we could not possibly create an overloaded java method, that covers all (infinite many) possibilities. And even if we restricted ourselves to do overloading for "well known" types only, like Int, Long, String, Bool, Char, Double, Float we still had to create 8^k overloaded methods, where k is the arity of the method.

To supplement this, there should also be utility functions for common tasks like converting a list to Iterable or vice versa. Also, for handling of IO and ST values.

Implementation details

I suggest first writing a command line tool that can work independently of the compiler. This will be valuable in any case, as someone might decide to use a library from java despite the devolper did not anticipate this and the source code is not available.

If the need arises, we can create syntax like

derive native class Foo(foo, bar, baz)

newtypes not properly supported in native types

Consider:

data STData s a = Mut a

data Date = pure native java.util.Date where
    native new :: () -> IO (STData RealWorld Date)          -- bad code  
    native show toString :: STData s Date -> ST s String    -- code gen complains

The new method runs new java.lang.Object(), should be new java.util.Date()

The show method gets complaint: Cannot invoke instance method toString on non native type

Cannot declare operators

We can't declare those functions as 'operators':

>>>
<<<
***
&&&

Good part, I think I'm able to fix it :)

Infixed operators cannot be qualified

Qualifiying infixed functions is baad:

good :: a -> [a] -> Bool
good x xs = Prelude.elem x xs

bad :: a -> [a] -> Bool
bad x xs = x `Prelude.elem` xs

The first one works, the second one doesn't:
can't resolve Prelude.elem

Add Java class X or method X.m to the standard library

Would it make sense to add the native java.net.URL() constructor to the URL data type? I can't figure out another way to get a URL instance.

Here's an example use case (note I made a new type called URL' to avoid collision with the existing frege type called URL):

type URL' = URLS' RealWorld
data URLS' s = native java.net.URL where
  native new :: String -> IO (Exception URL)

simpleHttp :: String -> IO (String)
simpleHttp urlStr = do
  url <- URL'.new urlStr
  case url of
    Left ex -> throw ex
    Right u -> do
      stream <- URL.openStream u
      case stream of
        Left ex -> throw ex
        Right s -> do
           isr <- InputStreamReader.new s
           br <- BufferedReader.fromISR isr
           lines <- BufferedReader.getlines br
           return $ foldl (++) "" $ map (++ "\n") lines

Native function cannot return non-exceptional IO (Either)

Given a Java class:

import frege.prelude.PreludeBase.TEither;

public class Bar {
  public static TEither bar(final String s) {
    return TEither.DRight.mk(0);
  }
}

The Frege module below fails compilation with "String is not a valid exception":

module Foo where

native bar Bar.bar :: String -> IO (Either String Int)

Provide a QuickCheck Tool

We need a command line tool that runs QuickCheck properties of a compiled Frege module.

The tool would inspect the symbol table of a module (much like the Doc tool does) to find out the names of the properties. For each name, the property would be checked by simulating execution of that property. This may involve a bit of java reflection hackery.

`$` tightly binds than `.`?

In the following code,

foo = take 10 . drop 5 $ (1 .. 20)

bar = take 10 <~ drop 5 $ (1 .. 20)

baz = take 10 • drop 5 $ (1 .. 20)

Only 'foo' fails with the compilation error:

type error in  expression drop 5$Enum... 1 20
    type is   [Int]
    used as   t2821->[t2822]

Compiler: frege3.20.14.jar

If we wrap it in braces, then it compiles.

foo = (take 10 . drop 5) $ (1 .. 20)

Is it a bug?

Maven Central

A short look through the subprojects here show that at least some of this stuff is already built using Maven. Is there any chance that the rest could be wrapped in simple Maven projects and everything pushed to Maven Central?

I'm sure I'm not the only one who would appreciate this! It's a great project.

Cheers,

Eli

ETA: FWIW, in particular I ask about this for the purpose of including the JSR 223 support for Frege scripting in a Java project, as discussed briefly here: https://groups.google.com/forum/?fromgroups=#!topic/frege-programming-language/aBJkJXOnUh4

It seems though that these classes - FregeScriptEngine and FregeScriptEngineFactory - are missing from the latest build of the frege-scripting jar, along with the META-INF/services entry. I guess this isn't the place to ask about that though so I'll read through the rest of that discussion and comment there I suppose I didn't find anything there about it so I'll create an issue in frege-scripting. Just mentioning it here for the sake of completeness in terms of where my inquiry is coming from.

Thanks again.

Constrained higher rank functions don't work

This is closely related to Issue #48

Consider:

with :: (Num a, Num b) => (forall e.Num e => [e]->[e]) -> [a] -> [b] -> ([a], [b])
with f xs ys = (f xs; f ys)

numfunc :: Num a => [a] -> [a]
numfunc = map (1+)

wrong = with numfunc [1..10] [1..10]

As before, the type of wrong is:

 Num t3243#e => ([Int],[Int])

We must get rid of the context with the rigid type variable.
In addition, code generation lacks in two points:

  • In with, the constraints are not given to f
  • In wrong, it is attempted to give a constraint to numfunc (which fails, because there is none).

We currently have no way to pass a function that expects constraints and arguments. Yet if we would treat a function with arity n and k constraints as Lambda(k+n) we could even simplify code generation.

some "public" functions are not exported

Hi,

first of all I want to apologize that I don't have a minimal running example for my problem.
However, it should still be readable and understandable:

I am currently implementing a module like Haskell's Data.Map based on https://github.com/Frege/frege/blob/master/contrib/dgronau/Set.fr

Now the problem is, that functions like "delete" or "findMin" can't be found in my test-module, even though they are not protected/private.

Here's the code (TestMap is the important one - the others just make the package complete):
Map: http://pastie.org/5842559
Utils: http://pastie.org/5842561
TestMap: http://pastie.org/5842562#31-34,38,40,44,46,61,71

The lines the the errors are marked in the TestMap-code:
The error-messages are:
Cannot resolve Map.delete, did you mean Map.delta perhaps?
Cannot resolve Map.findMin, did you mean Map.find perhaps?
Cannot resolve Map.findMax, did you mean Map.find perhaps?
Cannot resolve Map.foldr, did you mean Map.filter perhaps?
Cannot resolve Map.foldl, did you mean Map.find perhaps?

I just don't understand the error because all those functions are really exported by frege.data.Map.

I'm using fregIDE3.20.99 and frege3.20.113.

Is there an error in the compiler or did I make a huge mistake somewhere?

Higher Rank Type not propagated upwards

The following function

with (f::forall u.[u]->[u]) xs ys = (f xs; f ys)

gets a wrong type assigned:

with :: ([β]->[β]) -> [α] -> [γ] -> ([α], [γ])

Correct would be:

with :: (forall β.[β]->[β]) -> [α] -> [γ] -> ([α], [γ])

This can be exploited like so:

wrong = with (map (1+)) ['1', '2', '3'] [true, false]

The typechecker would reject this application in the presence of the forall, because a function (map (1+) :: [Int] -> [Int]) is not as polymorphic as [e]->[e].
But as it stands, it doesn't reject it and hence a Int->Int function is applied to non-ints.

Unfortunately, it may not be easy to infer a polymorphic type and hand it upwards.

A solution would be to forbid forall types in patterns.

Allow overlapping instances

Allow

data T a b = T a b
class C c where foo :: c -> String
instance C (T Int a)  where foo _ = "inst1"
instance C (T a Bool) where foo _ = "inst2"

bar = foo (T 42 42) ++ foo (T "x" true)   -- "inst1inst2"
wrong1 a = foo (T 42 a)    -- ERROR: a could be Bool
wrong2 a = foo (T a false) -- ERROR: a could be Int

Allow multiple instances

Allow multiple instances for T with different non-variable type arguments.

instance C (T Int)
instance C (T Bool)

This does not allow overlapping instances like:

instance C (T Int a)
instance C (T a Bool)

Kind Inference lacking

Currently it is not possible to enter type signatures with higher kinded type arguments, though higher kinded types are otherwise fully supported.

Specifically, the code that translates a TApp to internal form checks that all arguments have kind * and emits a blemish error message if this is not so.

Please add the enumFrom... functions to the Prelude

These functions are part of the Enum type-class in Haskell.

Here are some preliminary implementations:

enumFrom :: Enum a => a -> [a]
enumFrom x = iterate succ x

enumFromThen :: Enum a => a -> a -> [a]
enumFromThen x y = map from $ iterate (+delta) start where
   start = ord x
   delta = ord y - start

enumFromTo :: Enum a => a -> a -> [a]
enumFromTo x y = x .. y

enumFromThenTo :: Enum a => a -> a -> a -> [a]
enumFromThenTo x1 x2 y = takeWhile cmpY $ enumFromThen x1 x2 where
  cmpY | x1 <= x2 = (<= y)
       | otherwise = (>= y) 

Error on dictionary passing on either where and let declaration

Firstly the issue's title might be misleading, it's just a supposition.

Lately, I was porting Pipe library to Frege. I'm not a fan of how Pipes are currently encoded in Haskell, I use CPS instead.

Here's some code

data Proxy a' a b' b m r = Proxy { runProxy :: forall c.
                                   (r  -> m c) ->                                -- Yield r
                                   (a' -> (a  -> Proxy a' a b' b m r) -> m c) -> -- Request a' (a  -> Proxy a' a b' b m r))
                                   (b  -> (b' -> Proxy a' a b' b m r) -> m c) -> -- Respond b  (b' -> Proxy a' a b' b m r))
                                    m c
                                 }

instance Functor (Proxy a' a b' b m) where
  fmap f (Proxy k) = Proxy go
    where                                                                                                                                                               
      go ky kq kp = 
        let onRequest a' q = kq a' (fmap f . q)                                                                                                                                                                      
            onRespond b  p = kp b  (fmap f . p)                                                                                                                                                           
        in k (ky . f) onRequest onRespond

Sadly, it doesn't compile unlike in Haskell. Here's the compiler output

E proxy.fr:18: function `onRespond{2819}` has context Functor (Proxy γ β δ α
    ζ) =>
E proxy.fr:17: function `onRequest{2818}` has context Functor (Proxy γ β δ α
    ζ) =>

I'm using frege3.20.42.jar

Any idea ?

Bad java code for constrained values with polymorphic types

For example:

good = Nothing
bad :: Ord a => Maybe a
bad = good

Java code:

// Bind {Maybe α, Lazy<PreludeBase.TMaybe>, PreludeBase.TMaybe.DNothing.it}
// value `good`  u  {RAlways, RSimple, RSafeTC}
// forall α.Maybe α
// Nothing
final public static frege.runtime.Lazy good = PreludeBase.TMaybe.DNothing.it;
// value `bad`  u  {RAlways, RSimple, RSafeTC}
// forall a.Ord a => Maybe a  
// good
final public static PreludeBase.TMaybe bad(final PreludeBase.COrd ctx$1) {
     // return Lazy<PreludeBase.TMaybe>  Nothing
     // Bind {Maybe a, Lazy<PreludeBase.TMaybe>, PreludeBase.TMaybe.DNothing.it}
     return Scrap.good;    // ########ERRROR: Lazy is not Maybe
}

The return type of bad() must be Lazy, according to the r-state values (RAlways).

MonadIO for IO resulting in Java compilation errors

Java compiler complains about the following instance declaration for IO's MonadIO whereas it works fine for other instances.

class MonadIO (Monad m) => m where
  liftIO :: IO a -> m a

instance MonadIO IO where
  liftIO = id

Java compilation error messages:

The type HelloWorld.IMonadIO_IO must implement the inherited abstract method PreludeMonad.CMonad.ƒ_gt_gt_eq()
The type HelloWorld.IMonadIO_IO must implement the inherited abstract method PreludeMonad.CApplicative.ƒ_return()

Constraints go unchecked with higher rank types.

In the following program:

with :: (forall e.[e]->[e]) -> [a] -> [b] -> ([a], [b])
with f xs ys = (f xs; f ys)

numfunc :: Num a => [a] -> [a]
numfunc = map (1+)

chars = ['a' .. 'z']
bools = [true, false]

wrong = with numfunc chars bools

it infers for wrong the following type:

Num t3233#e => ([Char],[Bool])

leaving a skolemized meta variable in the constraint.
(Later, this results in a error in GenMeta)

But it should refuse the attempt to pass numfunc, because its type is less general than the one in the annotation.

Local self recursive values do not work.

What steps will reproduce the problem?

foo = head ones where ones = 1:ones

What is the expected output? What do you see instead?

javac complains:

The local variable ones_2793 may not have been initialized

Please use labels and text to provide additional information.

Indeed, the code for ones (inside another method) looks like:

      // let ones=1:ones in ...
      // value `ones{2793}`  s  0
      // [Int]
      // 1:ones
      final Lazy<FV> ones_2793 = 
        new Unknown<FV>() {
          final public Lazy<FV> _v() {
            // return RBoxed  1:ones
            // Bind {RBoxed, [Int], PreludeBase.TList, complicated java expression}
            return PreludeBase.TList.DCons.mk(ij.int1, ones_2793);
          }
        }
      ;

It can't close over ones_2793.
The same code is generated on the top level, but here the variable is static, so no closure needed.

New hierarchy of directories

I think we should have a new project directory' hierarchy.

Insteaf of having a trunk directory, we could have this project layout:

compiler/
std/ -- standard library
runtime/
doc/

FregIDE and examples should have their own project

Type alias unexpansion leads to nonsense in generated documentation

What steps will reproduce the problem ?

create a documentation for code with type aliases

What is the expected output? What do you see instead ?

The documentation should show the expansion of the type alias, as given in the source code. Because of mistakenly applied type alias unexpansion, however, the right hand side of every T a ... z appears as just T a ... z

Please use labels and text to provide additional information

java.lang.Error when defining Category (->)

Hi !

I've got java.lang.Error: java.util.concurrent.ExecutionException: frege.RT$Undefined: unJust Nothing
when I try to compile this:

instance Category (->) where
  id =  error "Whatever I wrote here" -- \x -> x
  f . g = error "Whatever I wrote here" -- \a -> f (g a)

Here's the full stacktrace:

Exception in thread "main" java.lang.Error: java.util.concurrent.ExecutionException: frege.RT$Undefined: unJust Nothing
    at frege.RT.fjMain(RT.java:334)
    at frege.compiler.Main.main(Main.java:8358)
Caused by: java.util.concurrent.ExecutionException: frege.RT$Undefined: unJust Nothing
    at java.util.concurrent.ForkJoinTask.get(ForkJoinTask.java:942)
    at frege.RT.fjMain(RT.java:329)
    ... 1 more
Caused by: frege.RT$Undefined: unJust Nothing
    at frege.prelude.PreludeBase.error(PreludeBase.java:16140)
    at frege.prelude.Maybe.unJust(Maybe.java:1434)
    at frege.prelude.Maybe$Lambda1a.eval(Maybe.java:1542)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Data$Lambda2b.eval(Data.java:53915)
    at frege.rt.Lam2$2._v(Lam2.java:88)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Data$Lambda2b.eval(Data.java:54041)
    at frege.rt.Lam2$2._v(Lam2.java:88)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Data$Lambda1b.eval(Data.java:55338)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.GenJava7$Lambda1a.eval(GenJava7.java:35740)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Utilities$Lambda3a.eval(Utilities.java:26536)
    at frege.rt.Lam3$2._v(Lam3.java:81)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Utilities$Lambda2a.eval(Utilities.java:26316)
    at frege.rt.Lam2$2._v(Lam2.java:88)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Utilities$67.eval(Utilities.java:20541)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.GenJava7$17.eval(GenJava7.java:7818)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.GenJava7$43.eval(GenJava7.java:15724)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Data$11.eval(Data.java:50599)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.GenJava7$92.eval(GenJava7.java:31645)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Data$11.eval(Data.java:50599)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.GenJava7$77$1$2.eval(GenJava7.java:27258)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.GenJava7$77$1.eval(GenJava7.java:27492)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Main$32$1.eval(Main.java:5328)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.prelude.PreludeBase$TState$1.eval(PreludeBase.java:10254)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Main$1L9262$1._v(Main.java:774)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Main$1L9262.work(Main.java:789)
    at frege.compiler.Main$1L9262.eval(Main.java:824)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Main$15.eval(Main.java:2540)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.compiler.Main$12.eval(Main.java:2213)
    at frege.rt.Lam1$1._v(Lam1.java:71)
    at frege.rt.Unknown._e(Unknown.java:384)
    at frege.RT$1.call(RT.java:311)
    at java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1288)
    at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:334)
    at java.util.concurrent.ForkJoinWorkerThread.execTask(ForkJoinWorkerThread.java:604)
    at java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:784)
    at java.util.concurrent.ForkJoinPool.work(ForkJoinPool.java:646)
    at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:398)

Regards

Incomplete inlining

What steps will reproduce the problem?

  1. foo a b = (const • id) a b

What is the expected output? What do you see instead?

--> const (id a) b eliminate (•)
--> const a b eliminate id
--> a eliminate const

but it stops after the second step.

Please use labels and text to provide additional information.

Hypothesis: (((const • id) a) b) cannot be simplified, hence it does ((const • id) a) resulting in (const a), but then ((const a) b) is not reconsidered.

Android / Dalvik?

Looking over this project, am I right in understanding that JVM bytecodes are produced directly, and thus Frege cannot be used for Android?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.