Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 61 lines (37 sloc) 1.082 kB
ff2d94c @tomlokhorst Cleaned up Main example.
authored
1 {-# LANGUAGE
2 NoImplicitPrelude
3 , RankNTypes
4 #-}
8b57a9e @tomlokhorst Initial checkin
authored
5
6 module Main where
7
8 import AwesomePrelude
9 import HaskellPrelude
10 import JsPrelude
11
9cd320d Less string literals.
Sebastiaan Visser authored
12 import Prelude (Int)
ef4abad @tomlokhorst Example of how partial application fails (see `epicfail`)
authored
13 import qualified Prelude as P
8b57a9e @tomlokhorst Initial checkin
authored
14
15
ff2d94c @tomlokhorst Cleaned up Main example.
authored
16 -- Switch between these two types and run `test` to see the AwesomePrelude in action!
41c088e @tomlokhorst Clearified example.
authored
17
40d631e @tomlokhorst Made some more changes, code is better now.
authored
18 f :: Js JsBool -> Js JsBool
19 --f :: P.Bool -> P.Bool
20 f x = not x && false || true
41c088e @tomlokhorst Clearified example.
authored
21
ff2d94c @tomlokhorst Cleaned up Main example.
authored
22 test = f true
41c088e @tomlokhorst Clearified example.
authored
23
24
25
26
27
28
29
30
31
32
33
34
35
36
f8df28b @tomlokhorst Working on Eq...
authored
37 -- listy :: [Int]
38 -- listy = 3 `cons` (4 `cons` nil)
39
40 -- bool' :: a -> a -> P.Bool -> a
41 -- bool' x y b = if b then x else y
42 --
43 -- f :: (forall a. a -> a -> b -> a) -> a -> b -> a
44 -- f g a b = g a a b
45 --
46 -- ok = f bool'
47 -- -- epicfail = f bool
48 --
49 -- hi = maybe false not
50 -- (just true :: P.Maybe P.Bool)
51 -- -- (just true :: JsC1 JsMaybe (Js JsBool))
52 --
53 -- yo = either (P.* 5) (P.const 2)
54 -- (right false :: P.Either P.Int P.Bool)
55 -- -- (right false :: JsC2 JsEither (Js JsNumber) (Js JsBool))
56 --
57 -- ah = tuple2 (\x y -> x && P.const false y)
58 -- (ctuple2 true 3 :: (,) P.Bool P.Int)
59 -- -- (ctuple2 true 3 :: JsC2 JsTuple2 (Js JsBool) (Js JsNumber))
8b57a9e @tomlokhorst Initial checkin
authored
60
Something went wrong with that request. Please try again.