Skip to content

Instantly share code, notes, and snippets.

@mmhelloworld
Last active December 15, 2015 15:09
Show Gist options
  • Select an option

  • Save mmhelloworld/5279743 to your computer and use it in GitHub Desktop.

Select an option

Save mmhelloworld/5279743 to your computer and use it in GitHub Desktop.
Test Frege-Java interop
module fregeforjava.Foo where
class A a where
f1 :: a -> Bool
f2 :: a -> Int -> [a]
data D1 = D1 String Int
derive Show D1
instance A D1 where
f1 (D1 s n) = n > 5
f2 d m = replicate m d
funct :: Bool -> D1 -> D1 -> D1
funct _ (D1 s1 n1) (D1 s2 n2) = D1 (s1 ++ s2) (n1 + n2)
main _ = println $ D1 "Hello" 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment