mirror of
https://github.com/unisonweb/unison.git
synced 2024-09-20 06:47:15 +03:00
Merge branch 'master' into topic/transcripts
This commit is contained in:
commit
919cd98a75
@ -20,7 +20,7 @@ before_install:
|
||||
|
||||
install:
|
||||
- stack ghc -- --version
|
||||
- travis_wait stack --no-terminal build
|
||||
- stack --no-terminal build
|
||||
|
||||
script:
|
||||
- stack --no-terminal exec tests
|
||||
|
@ -43,6 +43,7 @@ where
|
||||
|
||||
import Unison.Prelude
|
||||
|
||||
import qualified Control.Monad.Fail as MonadFail
|
||||
import Control.Monad.Reader.Class
|
||||
import Control.Monad.State ( get
|
||||
, put
|
||||
@ -1689,6 +1690,9 @@ instance Monad (M v loc) where
|
||||
(a, env1) <- runM m menv
|
||||
runM (f a) (menv { env = env1 })
|
||||
|
||||
instance MonadFail.MonadFail (M v loc) where
|
||||
fail = error
|
||||
|
||||
instance Applicative (M v loc) where
|
||||
pure = return
|
||||
(<*>) = ap
|
||||
|
@ -5,6 +5,7 @@ module Unison.Typechecker.Extractor where
|
||||
|
||||
import Unison.Prelude hiding (whenM)
|
||||
|
||||
import Control.Monad.Fail ( MonadFail, fail )
|
||||
import Control.Monad.Reader
|
||||
import qualified Data.List as List
|
||||
import qualified Data.Set as Set
|
||||
@ -305,8 +306,11 @@ instance Applicative (SubseqExtractor' n) where
|
||||
pure = return
|
||||
(<*>) = ap
|
||||
|
||||
instance Monad (SubseqExtractor' n) where
|
||||
instance MonadFail (SubseqExtractor' n) where
|
||||
fail _ = mzero
|
||||
|
||||
instance Monad (SubseqExtractor' n) where
|
||||
fail = Control.Monad.Fail.fail
|
||||
return a = SubseqExtractor' $ \_ -> [Pure a]
|
||||
xa >>= f = SubseqExtractor' $ \note ->
|
||||
let as = runSubseq xa note in do
|
||||
|
14
stack.yaml
14
stack.yaml
@ -10,15 +10,15 @@ packages:
|
||||
- parser-typechecker
|
||||
|
||||
#compiler-check: match-exact
|
||||
resolver: lts-12.14
|
||||
resolver: lts-14.7
|
||||
|
||||
extra-deps:
|
||||
- base58-bytestring-0.1.0
|
||||
- strings-1.1
|
||||
- relation-0.2.1
|
||||
- guid-0.1.0
|
||||
- shellmet-0.0.1
|
||||
- fsutils-0.1.2
|
||||
- strings-1.1@sha256:0285dec4c8ab262359342b3e5ef1eb567074669461b9b38404f1cb870c881c5c
|
||||
- guid-0.1.0@sha256:a7c975be473f6f142d5cc1b39bc807a99043d20b1bb0873fdfe7a3ce84d2faf1
|
||||
- fsutils-0.1.2@sha256:fb3eb68e03e4317352032642d3ed18c796c30f5a3bec40caef69cee0b859df5e
|
||||
- prelude-extras-0.4.0.3@sha256:1c10b0123ea13a6423d74a8fcbaeb2d5249b472588abde418a36b47b7c4f48c8
|
||||
- sandi-0.5@sha256:b278d072ca717706ea38f9bd646e023f7f2576a778fb43565b434f93638849aa
|
||||
- megaparsec-6.5.0
|
||||
|
||||
ghc-options:
|
||||
# All packages
|
||||
|
@ -9,6 +9,8 @@ import Control.Concurrent
|
||||
import Control.Concurrent.STM
|
||||
import Control.Exception
|
||||
import Control.Monad
|
||||
import Control.Monad.Fail (MonadFail)
|
||||
import qualified Control.Monad.Fail
|
||||
import Control.Monad.IO.Class
|
||||
import Control.Monad.Reader
|
||||
import Data.List
|
||||
@ -363,7 +365,7 @@ instance MonadReader Env Test where
|
||||
reader f = Test (Just <$> reader f)
|
||||
|
||||
instance Monad Test where
|
||||
fail = crash
|
||||
fail = Control.Monad.Fail.fail
|
||||
return a = Test $ do
|
||||
allow <- asks (null . allow)
|
||||
pure $ case allow of
|
||||
@ -375,6 +377,9 @@ instance Monad Test where
|
||||
Nothing -> pure Nothing
|
||||
Just a -> let Test t = f a in t
|
||||
|
||||
instance MonadFail Test where
|
||||
fail = crash
|
||||
|
||||
instance Functor Test where
|
||||
fmap = liftM
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user