Created
March 28, 2014 03:04
-
-
Save puffnfresh/9824390 to your computer and use it in GitHub Desktop.
Final file from http://www.meetup.com/frontier-developers/events/169067772/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x :: Int | |
x = 100 | |
hello :: String | |
hello = "Hello world" | |
shorter = "Hello world" | |
f :: Int -> Int | |
f n = n + 10 | |
g :: Int -> Int | |
g = (\n -> n + 10) | |
ten :: Int | |
ten = f 0 | |
-- Test | |
{- | |
{- | |
Hello | |
-} | |
-} | |
eleven :: Int | |
eleven = ((+) 10) 1 | |
addOne :: Int -> Int | |
addOne = (+) 1 | |
infixl 9 ^&^ | |
(^&^) :: Int -> Int -> Int | |
(^&^) = (+) | |
-- a -> (a -> a) | |
data Person = Person String String deriving Show | |
data Booleane = Truee | Falsee | |
data Maybee a = Juste a | Nothinge deriving Show | |
something :: Maybee Int | |
something = Juste 10 | |
nothing :: Maybee Int | |
nothing = Nothinge | |
y :: Maybee Int -> Int | |
y m = case m of | |
Juste n -> n + 1 | |
Nothinge -> 0 | |
h :: IO () | |
h = print (let n = 10 in n * n) | |
j :: Maybee Int -> IO () | |
j m | |
| x < 100 = print x | |
| otherwise = putStrLn "Bub" | |
where x = case m of | |
Juste n -> n + 1 | |
Nothinge -> 0 | |
class Appendable a where | |
append :: a -> a -> a | |
instance Appendable Int where | |
append a b = a + b | |
instance Appendable Bool where | |
append a b = a && b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment