Skip to content

Instantly share code, notes, and snippets.

@hdgarrood
Created December 29, 2015 04:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hdgarrood/b55b7dd7e9e1ca43b7b2 to your computer and use it in GitHub Desktop.
Save hdgarrood/b55b7dd7e9e1ca43b7b2 to your computer and use it in GitHub Desktop.

Module Neon

Re-exported from Neon.Class:

Add

class Add a where
  add :: a -> a -> a
Instances
Add (Array a)
Add Int
Add Number
Add String

Always

class Always a where
  always :: forall b c. a b (a c b)
Instances
Always Function

And

class And a where
  and :: a -> a -> a
Instances
And Boolean

Apply

class Apply a where
  apply :: forall b c. a (b -> c) -> a b -> a c
Instances
Apply Array

Bind

class Bind a where
  bind :: forall b c. a b -> (b -> a c) -> a c
Instances
Bind Array

Bottom

class Bottom a where
  bottom :: a
Instances
Bottom Boolean
Bottom Char
Bottom Int
Bottom Number

Compose

class Compose a where
  compose :: forall b c d. a b c -> a c d -> a b d
Instances
Compose Function

Divide

class Divide a where
  divide :: a -> a -> a
Instances
Divide Int
Divide Number

Equal

class Equal a where
  equal :: a -> a -> Boolean
Instances
(Equal a) => Equal (Array a)
Equal Boolean
Equal Char
Equal (a -> b)
Equal Int
Equal Number
Equal String

Flip

class Flip a where
  flip :: forall b c d. a b (a c d) -> a c (a b d)
Instances
Flip Function

FromArray

class FromArray a b where
  fromArray :: Array a -> b
Instances
FromArray a (Array a)
FromArray Char String

FromInt

class FromInt a where
  fromInt :: Int -> Maybe a
Instances
FromInt Boolean
FromInt Char
FromInt Int

Greater

class Greater a where
  greater :: a -> a -> Boolean
Instances
(Equal a, Greater a) => Greater (Array a)
Greater Boolean
Greater Char
Greater Int
Greater Number
Greater String

Identity

class Identity a where
  identity :: forall b. a b b
Instances
Identity Function

Less

class Less a where
  less :: a -> a -> Boolean
Instances
(Equal a, Less a) => Less (Array a)
Less Boolean
Less Char
Less Int
Less Number
Less String

Map

class Map a where
  map :: forall b c. (b -> c) -> a b -> a c
Instances
Map Array

Multiply

class Multiply a where
  multiply :: a -> a -> a
Instances
Multiply Int
Multiply Number

Not

class Not a where
  not :: a -> a
Instances
Not Boolean

One

class One a where
  one :: a
Instances
One Int
One Number

Or

class Or a where
  or :: a -> a -> a
Instances
Or Boolean

Power

class Power a where
  power :: a -> a -> a
Instances
Power Int
Power Number

Pure

class Pure a where
  pure :: forall b. b -> a b
Instances
Pure Array

Reduce

class Reduce a where
  reduce :: forall b c. (c -> b -> c) -> c -> a b -> c
Instances
Reduce Array

Remainder

class Remainder a where
  remainder :: a -> a -> a
Instances
Remainder Int

Root

class Root a where
  root :: a -> a -> a
Instances
Root Int
Root Number

Show

class Show a where
  show :: a -> String
Instances
(Show a) => Show (Array a)
Show Boolean
Show Char
Show (a -> b)
Show Int
Show Number
Show {  | a }
Show String

Subtract

class Subtract a where
  subtract :: a -> a -> a
Instances
Subtract Int
Subtract Number

ToArray

class ToArray a b where
  toArray :: a -> Array b
Instances
ToArray (Array a) a
ToArray String Char

ToInt

class ToInt a where
  toInt :: a -> Int
Instances
ToInt Boolean
ToInt Char
ToInt Int

Top

class Top a where
  top :: a
Instances
Top Boolean
Top Char
Top Int
Top Number

Traverse

class Traverse t where
  traverse :: forall a b m. (Apply m, Map m, Pure m) => (a -> m b) -> t a -> m (t b)
Instances
Traverse Array
Traverse List

Zero

class Zero a where
  zero :: a
Instances
Zero (Array a)
Zero Int
Zero Number
Zero String

Re-exported from Neon.Data:

Dictionary

data Dictionary :: * -> *
Instances
Add (Dictionary a)
(Equal a) => Equal (Dictionary a)
FromArray (Pair String a) (Dictionary a)
Map Dictionary
Reduce Dictionary
(Show a) => Show (Dictionary a)
ToArray (Dictionary a) (Pair String a)
Zero (Dictionary a)

Exception

data Exception :: *
Instances
Equal Exception
Show Exception

exception

exception :: String -> Exception

List

data List a
  = Nil
  | Cons a (List a)
Instances
(Equal a) => Equal (List a)
FromArray a (List a)
Map List
Reduce List
(Show a) => Show (List a)
ToArray (List a) a

Maybe

data Maybe a
  = Nothing
  | Just a
Instances
Apply Maybe
Bind Maybe
(Equal a) => Equal (Maybe a)
FromArray a (Maybe a)
(Greater a) => Greater (Maybe a)
(Less a) => Less (Maybe a)
Map Maybe
Pure Maybe
(Show a) => Show (Maybe a)
ToArray (Maybe a) a

maybe

maybe :: forall a b. (a -> b) -> b -> Maybe a -> b

Pair

newtype Pair a b
  = Pair { first :: a, second :: b }
Instances
(Equal a, Equal b) => Equal (Pair a b)
(Show a, Show b) => Show (Pair a b)

pair

pair :: forall a b. a -> b -> Pair a b

Unit

newtype Unit
Instances
Equal Unit
Show Unit

unit

unit :: Unit

Re-exported from Neon.Effect:

CONSOLE

data CONSOLE :: !

info

info :: forall a. String -> Effect (console :: CONSOLE | a) Unit

log

log :: forall a. String -> Effect (console :: CONSOLE | a) Unit

warn

warn :: forall a. String -> Effect (console :: CONSOLE | a) Unit

error

error :: forall a. String -> Effect (console :: CONSOLE | a) Unit

Effect

data Effect :: # ! -> * -> *
Instances
Apply (Effect a)
Bind (Effect a)
Map (Effect a)
Pure (Effect a)

runPure

runPure :: forall a. Effect () a -> a

unsafeRunEffect

unsafeRunEffect :: forall a b. Effect a b -> b

EXCEPTION

data EXCEPTION :: !

catch

catch :: forall a b. Effect (exception :: EXCEPTION | a) b -> (Exception -> Effect a b) -> Effect a b

throw

throw :: forall a b. Exception -> Effect (exception :: EXCEPTION | a) b

Re-exported from Neon.Helper:

absoluteValue

absoluteValue :: forall a. (Less a, Subtract a, Zero a) => a -> a

all

all :: forall a b. (Reduce a) => (b -> Boolean) -> a b -> Boolean

any

any :: forall a b. (Reduce a) => (b -> Boolean) -> a b -> Boolean

asTypeOf

asTypeOf :: forall a. a -> a -> a

clamp

clamp :: forall a. (Greater a, Less a) => a -> a -> a -> a

contains

contains :: forall a b. (Equal b, Reduce a) => b -> a b -> Boolean

curry

curry :: forall a b c. (Pair a b -> c) -> a -> b -> c

decrement

decrement :: forall a. (FromInt a, ToInt a) => a -> Maybe a

for

for :: forall a b c. (Map a) => a b -> (b -> c) -> a c

greaterOrEqual

greaterOrEqual :: forall a. (Equal a, Greater a) => a -> a -> Boolean

increment

increment :: forall a. (FromInt a, ToInt a) => a -> Maybe a

isEmpty

isEmpty :: forall a b. (Reduce a) => a b -> Boolean

isInfinite

isInfinite :: Number -> Boolean

isJust

isJust :: forall a. Maybe a -> Boolean

isNothing

isNothing :: forall a. Maybe a -> Boolean

join

join :: forall a b. (Bind a) => a (a b) -> a b

lessOrEqual

lessOrEqual :: forall a. (Equal a, Less a) => a -> a -> Boolean

max

max :: forall a. (Greater a) => a -> a -> a

maximum

maximum :: forall a b. (Greater b, Reduce a) => a b -> Maybe b

min

min :: forall a. (Less a) => a -> a -> a

minimum

minimum :: forall a b. (Less b, Reduce a) => a b -> Maybe b

negate

negate :: forall a. (Subtract a, Zero a) => a -> a

notEqual

notEqual :: forall a. (Equal a) => a -> a -> Boolean

print

print :: forall a. (Show a) => a -> Effect (console :: CONSOLE) Unit

product

product :: forall a b. (Multiply b, One b, Reduce a) => a b -> b

range

range :: forall a. (FromInt a, Greater a, ToInt a) => a -> a -> Array a

reciprocal

reciprocal :: forall a. (Divide a, One a) => a -> a

sequence

sequence :: forall a b c. (Apply b, Map b, Pure b, Traverse a) => a (b c) -> b (a c)

sign

sign :: forall a. (Greater a, Less a, One a, Subtract a, Zero a) => a -> a

size

size :: forall a b. (Reduce a) => a b -> Int

sum

sum :: forall a b. (Add b, Reduce a, Zero b) => a b -> b

swap

swap :: forall a b. Pair a b -> Pair b a

uncurry

uncurry :: forall a b c. (a -> b -> c) -> Pair a b -> c

unless

unless :: forall a. (Pure a) => Boolean -> a Unit -> a Unit

unsafeFromJust

unsafeFromJust :: forall a. Maybe a -> a

unsafeLog

unsafeLog :: forall a. String -> a -> a

until

until :: forall a. (a -> Boolean) -> (a -> a) -> a -> a

void

void :: forall a b. (Map a) => a b -> a Unit

when

when :: forall a. (Pure a) => Boolean -> a Unit -> a Unit

while

while :: forall a. (a -> Boolean) -> (a -> a) -> a -> a

withDefault

withDefault :: forall a. a -> Maybe a -> a

Re-exported from Neon.Operator:

_compose

_compose :: forall a b c d. (Compose a) => a b c -> a c d -> a b d

_esopmoc

_esopmoc :: forall a b c d. (Compose a) => a c d -> a b c -> a b d

_power

_power :: forall a. (Power a) => a -> a -> a

_multiply

_multiply :: forall a. (Multiply a) => a -> a -> a

_divide

_divide :: forall a. (Divide a) => a -> a -> a

_remainder

_remainder :: forall a. (Remainder a) => a -> a -> a

_add

_add :: forall a. (Add a) => a -> a -> a

_subtract

_subtract :: forall a. (Subtract a) => a -> a -> a

_equal

_equal :: forall a. (Equal a) => a -> a -> Boolean

_notEqual

_notEqual :: forall a. (Equal a) => a -> a -> Boolean

_greater

_greater :: forall a. (Greater a) => a -> a -> Boolean

_greaterOrEqual

_greaterOrEqual :: forall a. (Equal a, Greater a) => a -> a -> Boolean

_less

_less :: forall a. (Less a) => a -> a -> Boolean

_lessOrEqual

_lessOrEqual :: forall a. (Equal a, Less a) => a -> a -> Boolean

_and

_and :: forall a. (And a) => a -> a -> a

_or

_or :: forall a. (Or a) => a -> a -> a

_apply

_apply :: forall a b. a -> (a -> b) -> b

_identity

_identity :: forall a b. (a -> b) -> a -> b

Re-exported from Neon.Primitive:

toLower

toLower :: Char -> Char

toString

toString :: Char -> String

toUpper

toUpper :: Char -> Char

toNumber

toNumber :: Int -> Number

ceiling

ceiling :: Number -> Int

floor

floor :: Number -> Int

infinity

infinity :: Number

isFinite

isFinite :: Number -> Boolean

isNaN

isNaN :: Number -> Boolean

nan

nan :: Number

round

round :: Number -> Int

truncate

truncate :: Number -> Int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment