summaryrefslogtreecommitdiff
path: root/Com/Simatime/Alpha.hs
blob: 16d21e3c9ae3f60d3761da39b997fb83ff868f79 (plain)
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
{-# LANGUAGE NoImplicitPrelude #-}
-- | Commonly useful functions, a Prelude replacement.
module Com.Simatime.Alpha
  (
  -- * Re-export Protolude
    module X
  -- * General functions
  , (/@)
  , (/@@)
  -- * Debugging tools
  , say
  -- * TODO: remove this
  , Prelude.read
  )
where

import           Data.Text                      ( Text )
import qualified Prelude
import           Protolude                     as X
import           Data.String

-- | Debugging printf
say :: Text -> IO ()
say msg = putStrLn msg

-- | Alias for map, fmap, <$>. Inspired by Mathematica.
(/@) :: Functor f => (a -> b) -> f a -> f b
(/@) = fmap

-- | Double fmap.
-- (/@@) :: (Functor f1, Functor f2) => f1 (a -> b) -> f1 (f2 a) -> f1 (f2 b)
(/@@) :: (Functor f0, Functor f1) => (a -> b) -> f0 (f1 a) -> f0 (f1 b)
(/@@) = fmap . fmap