functor module
This commit is contained in:
@@ -35,6 +35,7 @@ library
|
|||||||
Monad
|
Monad
|
||||||
Show
|
Show
|
||||||
Unsafe
|
Unsafe
|
||||||
|
Functor
|
||||||
|
|
||||||
default-extensions:
|
default-extensions:
|
||||||
NoImplicitPrelude
|
NoImplicitPrelude
|
||||||
|
|||||||
+9
-9
@@ -1,15 +1,15 @@
|
|||||||
{-# LANGUAGE NoImplicitPrelude #-}
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
|
|
||||||
module Debug (
|
module Debug (
|
||||||
undefined
|
undefined,
|
||||||
, error
|
error,
|
||||||
, trace
|
trace,
|
||||||
, traceM
|
traceM,
|
||||||
, traceIO
|
traceIO,
|
||||||
, traceShow
|
traceShow,
|
||||||
, traceShowM
|
traceShowM,
|
||||||
, notImplemented
|
notImplemented,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import qualified Prelude as P
|
import qualified Prelude as P
|
||||||
import qualified Debug.Trace as T
|
import qualified Debug.Trace as T
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
{-# LANGUAGE CPP #-}
|
||||||
|
{-# LANGUAGE NoImplicitPrelude #-}
|
||||||
|
|
||||||
|
module Functor (
|
||||||
|
Functor(..),
|
||||||
|
($>),
|
||||||
|
(<$>),
|
||||||
|
void,
|
||||||
|
) where
|
||||||
|
|
||||||
|
#if (__GLASGOW_HASKELL__ >= 710)
|
||||||
|
import Data.Functor (
|
||||||
|
Functor(..)
|
||||||
|
, ($>)
|
||||||
|
, (<$>)
|
||||||
|
, void
|
||||||
|
)
|
||||||
|
#else
|
||||||
|
import Data.Functor (
|
||||||
|
Functor(..)
|
||||||
|
, (<$>)
|
||||||
|
)
|
||||||
|
|
||||||
|
($>) :: Functor f => f a -> b -> f b
|
||||||
|
($>) = flip (<$)
|
||||||
|
|
||||||
|
void :: Functor f => f a -> f ()
|
||||||
|
void x = () <$ x
|
||||||
|
#endif
|
||||||
Reference in New Issue
Block a user