Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c2bd5156e7
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 78 lines (43 sloc) 1.223 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
{-# LANGUAGE
NoImplicitPrelude
, RankNTypes
#-}

module Main where

import AwesomePrelude
import HaskellPrelude
import JsPrelude

import Prelude (fromInteger)
import qualified Prelude as P


-- Switch between the two types and run `test*` to see the AwesomePrelude in action!

fb :: Js JsBool -> Js JsBool
--fb :: P.Bool -> P.Bool
fb x = not x && false || true

test = fb false



fEq :: Js JsBool -> Js JsBool
--fEq :: P.Bool -> P.Bool
fEq x = x == fb x

test2 = fEq false



fNumEq :: Js JsNumber -> Js JsNumber -> Js JsBool
--fNumEq :: P.Int -> P.Int -> P.Bool
fNumEq x y = x == (y P.- 1)

test3 = fNumEq 3 4



fM :: JsC1 JsMaybe (Js JsBool) -> Js JsBool
--fM :: P.Maybe P.Bool -> P.Bool
fM = maybe false not

test4 = fM (just false)



listy :: JsC1 JsList (Js JsNumber)
--listy :: [P.Int]
listy = 2 `cons` (3 `cons` (4 `cons` nil))



--fL :: JsC1 JsList (Js JsNumber) -> JsC1 JsList (Js JsNumber)
--fL = map (P.+1)

--test5 = fL listy



-- fL :: JsC1 JsList (Js JsNumber) -> Js JsNumber
-- fL = sum P.. map (P.+1)
--
-- test5 = fL listy


bool' :: a -> a -> P.Bool -> a
bool' x y b = if b then x else y

f :: (forall a. a -> a -> b -> a) -> a -> b -> a
f g a b = g a a b

ok = f bool'
-- epicfail = f bool

Something went wrong with that request. Please try again.