purescript-elm-basics
This is a Purescript port of the Basics
module from Elm's core library. This library only defines a few values, the rest are available from Purescript libraries or the Prelude.
This library is intended to help port Elm libraries and programs to Purescript.
Installation and Usage
bower install purescript-elm-basics
import Elm.Basics
Elm.Basics
Module Contents
Please also see the detailed Module Documentation.
-
The built-in type
Number
is used instead ofFloat
-
degrees
,radians
,turns
are functions with typeNumber -> Number
-
clamp :: Number -> Number -> Number -> Number
-
<|
and|>
are provided and synonymous with$
and#
Not Included
The other types and values from Elm's Basics
all have Purescript analogues and can be import
ed from their respective modules, so they were not included. Here's a short migration guide:
Prelude
-
==
,/=
,<
,>
,<=
,>=
,+
,-
,*
,/
,negate
,not
,&&
,||
,++
,otherwise
,flip
can be imported from Purescript'sPrelude
-
<<
and>>
become<<<
and>>>
fromPrelude
-
toString
is superseded by theshow
method of theShow
typeclass from Prelude -
identity
becomesid
, andalways
becomesconst
, fromPrelude
-
Order
becomesOrdering
and is used with thecompare
method of theOrd
typeclass from Prelude -
xor
becomes.^.
from theBits
type class, of which there is an instance forNum
Math
-
max
,min
,round
,floor
,abs
,sqrt
,e
,pi
,cos
,sin
,tan
,acos
,asin
,atan
,atan2
are in moduleMath
from purescript-math -
ceiling
becomesceil
, and^
becomespow
inMath
Data.Tuple
-
fst
,snd
,curry
,uncurry
are inData.Tuple
from purescript-tuples
Data.Int
-
toNumber
(to be used instead oftoFloat
), as well asfloor
,ceil
,round
and others are inData.Int
from purescript-integers
Global
-
isNaN
andisFinite
(negatedisInfinite
) available from purescript-globals
TODO
-
//
,rem
,%
,logBase
,truncate
-
toPolar
,fromPolar