Prelude.purs 1.58 KB
Newer Older
1
module Gargantext.Prelude (module Prelude, logs, id, class Read, read)
2 3
  where

4
import Data.Maybe (Maybe)
5
import Prelude (class Applicative, class Apply, class Bind, class BooleanAlgebra, class Bounded, class Category, class CommutativeRing, class Discard, class DivisionRing, class Eq, class EuclideanRing, class Field, class Functor, class HeytingAlgebra, class Monad, class Monoid, class Ord, class Ring, class Semigroup, class Semigroupoid, class Semiring, class Show, type (~>), Ordering(..), Unit, Void, absurd, add, ap, append, apply, between, bind, bottom, clamp, compare, comparing, compose, conj, const, degree, discard, disj, eq, flap, flip, gcd, identity, ifM, join, lcm, liftA1, liftM1, map, max, mempty, min, mod, mul, negate, not, notEq, one, otherwise, pure, recip, show, sub, top, unit, unless, unlessM, void, when, whenM, zero, (#), ($), ($>), (&&), (*), (*>), (+), (-), (/), (/=), (<), (<#>), (<$), (<$>), (<*), (<*>), (<<<), (<=), (<=<), (<>), (<@>), (=<<), (==), (>), (>=), (>=>), (>>=), (>>>), (||))
6
import Effect.Console (log)
7
import Effect.Class (class MonadEffect, liftEffect)
8 9


10 11 12 13 14 15 16 17
-- | JL: Astonishingly, not in the prelude
--   AD: recent Preludes in Haskell much prefer identity
--   then id can be used as a variable name (in records for instance)
--   since records in Purescript are not the same as in Haskell
--   this behavior is questionable indeed.
id :: forall a. a -> a
id a = a

18 19
class Read a where
  read :: String -> Maybe a
20

21
logs:: forall message effect.
22 23 24
       (MonadEffect effect)
       => Show message
       => message 
25 26 27
       -> effect Unit
logs = liftEffect <<< log <<< show

28 29