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.
bower install purescript-elm-basics
import Elm.Basics
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#
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:
-
==
,/=
,<
,>
,<=
,>=
,+
,-
,*
,/
,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
-
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
fst
,snd
,curry
,uncurry
are inData.Tuple
from purescript-tuples
toNumber
(to be used instead oftoFloat
), as well asfloor
,ceil
,round
and others are inData.Int
from purescript-integers
isNaN
andisFinite
(negatedisInfinite
) available from purescript-globals
-
//
,rem
,%
,logBase
,truncate
-
toPolar
,fromPolar