Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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