Skip to content

Commit 13ab0be

Browse files
committed
Merge pull request #22 from purescript-contrib/extract-identity
Updates for extracted Identity
2 parents 6337064 + 849992b commit 13ab0be

File tree

14 files changed

+27
-97
lines changed

14 files changed

+27
-97
lines changed

bower.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@
1818
"package.json"
1919
],
2020
"dependencies": {
21-
"purescript-tuples": "*",
22-
"purescript-either": "*",
23-
"purescript-monoid": "*",
24-
"purescript-arrays": "~0.2.0",
25-
"purescript-control": "~0.2.0"
21+
"purescript-tuples": "~0.2.1",
22+
"purescript-either": "~0.1.3",
23+
"purescript-monoid": "~0.1.4",
24+
"purescript-arrays": "~0.2.1",
25+
"purescript-control": "~0.2.1",
26+
"purescript-identity": "~0.1.0"
2627
},
2728
"devDependencies": {
2829
"purescript-strings": "*"

docs/Module.md

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228
### Types
229229

230230
newtype ContT r m a where
231-
ContT :: (a -> m r) -> m r -> ContT r m a
231+
ContT :: ((a -> m r) -> m r) -> ContT r m a
232232

233233

234234
### Type Class Instances
@@ -339,36 +339,6 @@
339339
runErrorT :: forall e m a. ErrorT e m a -> m (Either e a)
340340

341341

342-
## Module Control.Monad.Identity
343-
344-
### Types
345-
346-
newtype Identity a where
347-
Identity :: a -> Identity a
348-
349-
350-
### Type Class Instances
351-
352-
instance applicativeIdentity :: Applicative Identity
353-
354-
instance applyIdentity :: Apply Identity
355-
356-
instance bindIdentity :: Bind Identity
357-
358-
instance comonadIdentity :: Comonad Identity
359-
360-
instance extendIdentity :: Extend Identity
361-
362-
instance functorIdentity :: Functor Identity
363-
364-
instance monadIdentity :: Monad Identity
365-
366-
367-
### Values
368-
369-
runIdentity :: forall a. Identity a -> a
370-
371-
372342
## Module Control.Monad.Maybe.Trans
373343

374344
### Types
@@ -478,7 +448,7 @@
478448
### Types
479449

480450
newtype RWST r w s m a where
481-
RWST :: r -> s -> m (See s a w) -> RWST r w s m a
451+
RWST :: (r -> s -> m (See s a w)) -> RWST r w s m a
482452

483453
type See s a w = { log :: w, result :: a, state :: s }
484454

@@ -565,7 +535,7 @@
565535
### Types
566536

567537
newtype ReaderT r m a where
568-
ReaderT :: r -> m a -> ReaderT r m a
538+
ReaderT :: (r -> m a) -> ReaderT r m a
569539

570540

571541
### Type Class Instances
@@ -667,7 +637,7 @@
667637
### Types
668638

669639
newtype StateT s m a where
670-
StateT :: s -> m (Tuple a s) -> StateT s m a
640+
StateT :: (s -> m (Tuple a s)) -> StateT s m a
671641

672642

673643
### Type Class Instances

examples/Cont.purs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
module Main where
22

3-
import Prelude
43
import Control.Monad.Cont.Trans
54
import Control.Monad.Trans
65
import Debug.Trace

examples/Reader.purs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
module Main where
22

3-
import Prelude
4-
import Control.Monad.Eff
5-
import Control.Monad.Identity
63
import Control.Monad.Reader
74
import Control.Monad.Reader.Class
85
import Control.Monad.Reader.Trans
9-
import Data.String
6+
import Debug.Trace
107

118
testReader :: Reader String String
129
testReader = local (\x -> x ++ "!") ask
1310

1411
main = do
15-
Debug.Trace.print $ runReader testReader "Done"
12+
print $ runReader testReader "Done"

examples/State.purs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
module Main where
22

3-
import Prelude
4-
import Control.Monad.Eff
5-
import Control.Monad.Identity
63
import Control.Monad.State
74
import Control.Monad.State.Class
85
import Control.Monad.State.Trans
96
import Data.Tuple
7+
import Debug.Trace
108

119
incState :: forall eff a. State Number Unit
1210
incState = modify $ (+) 1
@@ -21,8 +19,7 @@ testState = do
2119
incState
2220
return "Done"
2321

24-
main = do
25-
case runState testState 0 of
26-
Tuple value state -> do
27-
Debug.Trace.print $ "state: " ++ (show state)
28-
Debug.Trace.print $ "value: " ++ (show value)
22+
main = case runState testState 0 of
23+
Tuple value state -> do
24+
print $ "state: " ++ (show state)
25+
print $ "value: " ++ (show value)

examples/Writer.purs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
module Main where
22

3-
import Prelude
4-
import Control.Monad.Eff
5-
import Control.Monad.Identity
63
import Control.Monad.Writer
74
import Control.Monad.Writer.Class
85
import Control.Monad.Writer.Trans
9-
import Data.Monoid
106
import Data.Tuple
7+
import Debug.Trace
118

129
testWriter :: Writer String Number
1310
testWriter = do
@@ -16,5 +13,5 @@ testWriter = do
1613

1714
main = case runWriter testWriter of
1815
Tuple value output -> do
19-
Debug.Trace.print $ output
20-
Debug.Trace.print $ value
16+
print $ output
17+
print $ value

src/Control/Comonad/Env.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Control.Comonad.Env where
22

33
import Control.Comonad.Env.Trans
4-
import Control.Monad.Identity
5-
4+
import Data.Identity
65
import Data.Tuple
76

87
type Env e = EnvT e Identity

src/Control/Comonad/Store.purs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module Control.Comonad.Store where
22

33
import Control.Comonad.Store.Trans
4-
import Control.Monad.Identity
5-
4+
import Data.Identity
65
import Data.Tuple
76

87
type Store s a = StoreT s Identity a

src/Control/Comonad/Traced.purs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Control.Comonad.Traced where
22

33
import Control.Comonad.Traced.Trans
4-
import Control.Monad.Identity
4+
import Data.Identity
55

66
type Traced m = TracedT m Identity
77

src/Control/Monad/Identity.purs

Lines changed: 0 additions & 29 deletions
This file was deleted.

0 commit comments

Comments
 (0)