Verified Commit e9b0f49b authored by Camil Staps's avatar Camil Staps 🙂

Add more strictness information

parent 1a9268df
Pipeline #17451 passed with stage
in 3 minutes and 13 seconds
......@@ -268,7 +268,7 @@ printDoc :: !d -> String | docToDocBlock{|*|} d
* The magic for {{`printDoc`}}.
* @param If true, return a `Left`. If false, return a `Right`.
*/
generic docToDocBlock d :: Bool d -> Either [String] DocBlock
generic docToDocBlock d :: !Bool !d -> Either [String] DocBlock
derive docToDocBlock ModuleDoc, FunctionDoc, ClassMemberDoc, ClassDoc,
ConstructorDoc, TypeDoc
......
......@@ -242,7 +242,7 @@ where
fields = filter ((<>) "description" o fst) fields`
desc = lookup "description" fields`
generic docToDocBlock a :: Bool a -> Either [String] DocBlock
generic docToDocBlock a :: !Bool !a -> Either [String] DocBlock
docToDocBlock{|String|} True s = Left [s]
docToDocBlock{|String|} _ _ = abort "error in docToDocBlock{|String|}\n"
docToDocBlock{|[]|} fx True xs = Left [x \\ Left xs` <- map (fx True) xs, x <- xs`]
......
......@@ -8,6 +8,7 @@ from Data.Maybe import :: Maybe
class MonadFix m | Monad m where
mfix :: (a -> m a) -> m a
instance MonadFix Maybe
instance MonadFix Maybe where
mfix :: !(a -> Maybe a) -> Maybe a
instance MonadFix []
......@@ -9,6 +9,7 @@ import Data.List
import Data.Maybe
instance MonadFix Maybe where
mfix :: !(a -> Maybe a) -> Maybe a
mfix f =
let a = f (unJust a) in a
where unJust (Just x) = x
......
......@@ -11,7 +11,7 @@ from Data.Monoid import class Monoid, class Semigroup
:: RWS r w s a :== RWST r w s Identity a
// The RWST monad transformer
:: RWST r w s m a = RWST (r s -> m (a, s, w))
:: RWST r w s m a = RWST !(r s -> m (a, s, w))
instance Functor (RWST r w s m) | Monad m & Monoid w
instance pure (RWST r w s m) | pure m & Monoid w
......@@ -26,9 +26,9 @@ execRWS :: (RWS r w s a) r s -> (s, w)
mapRWS :: ((a, s, w) -> (b, s, w`)) (RWS r w s a) -> RWS r w` s b
withRWS :: (r` s -> (r, s)) (RWS r w s a) -> RWS r` w s a
runRWST :: (RWST r w s m a) r s -> m (a, s, w)
evalRWST :: (RWST r w s m a) r s -> m (a, w) | Monad m
execRWST :: (RWST r w s m a) r s -> m (s, w) | Monad m
runRWST :: !(RWST r w s m a) r s -> m (a, s, w)
evalRWST :: !(RWST r w s m a) r s -> m (a, w) | Monad m
execRWST :: !(RWST r w s m a) r s -> m (s, w) | Monad m
mapRWST :: ((m (a, s, w)) -> n (b, s, w`)) (RWST r w s m a) -> RWST r w` s n b
withRWST :: (r` -> s -> (r, s)) (RWST r w s m a) -> RWST r` w s m a
......
......@@ -53,18 +53,15 @@ mapRWS f m = mapRWST (Identity o f o runIdentity) m
withRWS :: (r` s -> (r, s)) (RWS r w s a) -> RWS r` w s a
withRWS f m = withRWST f m
// The RWST monad transformer
:: RWST r w s m a = RWST (r s -> m (a, s, w))
runRWST :: (RWST r w s m a) r s -> m (a, s, w)
runRWST :: !(RWST r w s m a) r s -> m (a, s, w)
runRWST (RWST f) r s = f r s
evalRWST :: (RWST r w s m a) r s -> m (a, w) | Monad m
evalRWST :: !(RWST r w s m a) r s -> m (a, w) | Monad m
evalRWST m r s
= runRWST m r s
>>= \(a, _, w) -> pure (a, w)
execRWST :: (RWST r w s m a) r s -> m (s, w) | Monad m
execRWST :: !(RWST r w s m a) r s -> m (s, w) | Monad m
execRWST m r s
= runRWST m r s
>>= \(_, s`, w) -> pure (s`, w)
......
......@@ -6,18 +6,18 @@ from Control.Monad.Trans import class MonadTrans
from Data.Functor import class Functor
from Data.Functor.Identity import :: Identity
:: ReaderT r m a = ReaderT (r -> m a)
:: ReaderT r m a = ReaderT !(r -> m a)
:: Reader r a :== ReaderT r Identity a
runReaderT :: .(ReaderT .a u:b .c) -> .a -> u:(b .c)
runReaderT :: !.(ReaderT .a u:b .c) -> .a -> u:(b .c)
reader :: (.a -> .b) -> .(ReaderT .a .Identity .b)
runReader :: .(ReaderT .a u:Identity v:b) -> .(.a -> v:b), [u <= v]
mapReaderT :: (u:(a .b) -> v:(c .d)) .(ReaderT .e u:a .b) -> .(ReaderT .e v:c .d)
mapReader :: (u:a -> .b) -> .(.(ReaderT .c v:Identity u:a) -> .(ReaderT .c .Identity .b)), [v <= u]
withReaderT :: (.a -> .b) .(ReaderT .b .c .d) -> .(ReaderT .a .c .d)
withReader :: u:((.a -> .b) -> v:(.(ReaderT .b .c .d) -> .(ReaderT .a .c .d))), [v <= u]
liftReaderT :: (a .b) -> .(ReaderT .c a .b)
liftReaderT :: !(a .b) -> .(ReaderT .c a .b)
ask :: .(ReaderT a b a) | Monad b
local :: u:((.a -> .b) -> v:(.(ReaderT .b .c .d) -> .(ReaderT .a .c .d))), [v <= u]
asks :: (a -> b) -> ReaderT a c b | Monad c
......@@ -28,3 +28,5 @@ instance <*> (ReaderT r m) | Monad m
instance Monad (ReaderT r m) | Monad m
instance MonadTrans (ReaderT r)
where
liftT :: !(m a) -> ReaderT r m a | Monad m
......@@ -6,10 +6,6 @@ import Control.Applicative
from StdFunc import o, const
import Control.Monad.Trans
:: ReaderT r m a = ReaderT (r -> m a)
:: Reader r a :== ReaderT r Identity a
instance Functor (ReaderT r m) | Monad m where
fmap f m = liftM f m
......@@ -24,10 +20,12 @@ where
instance Monad (ReaderT r m) | Monad m where
bind m k = ReaderT (\r -> runReaderT m r >>= \a -> runReaderT (k a) r)
instance MonadTrans (ReaderT r) where
liftT r = liftReaderT r
instance MonadTrans (ReaderT r)
where
liftT :: !(m a) -> ReaderT r m a | Monad m
liftT r = liftReaderT r
runReaderT :: .(ReaderT .a u:b .c) -> .a -> u:(b .c)
runReaderT :: !.(ReaderT .a u:b .c) -> .a -> u:(b .c)
runReaderT (ReaderT f) = f
reader :: (.a -> .b) -> .(ReaderT .a .Identity .b)
......@@ -48,7 +46,7 @@ mapReaderT f m = ReaderT (f o runReaderT m)
withReaderT :: (.a -> .b) .(ReaderT .b .c .d) -> .(ReaderT .a .c .d)
withReaderT f m = ReaderT (runReaderT m o f)
liftReaderT :: (a .b) -> .(ReaderT .c a .b)
liftReaderT :: !(a .b) -> .(ReaderT .c a .b)
liftReaderT m = ReaderT (const m)
ask :: .(ReaderT a b a) | Monad b
......
......@@ -7,7 +7,7 @@ from Control.Monad.Trans import class MonadTrans
from Data.Functor import class Functor
from Data.Functor.Identity import :: Identity
:: WriterT w m a = WriterT (m (a, w))
:: WriterT w m a = WriterT !(m (a, w))
:: Writer w a :== WriterT w Identity a
......@@ -17,17 +17,18 @@ instance <*> (WriterT w m) | Monad m & Monoid w
instance Monad (WriterT w m) | Monad m & Monoid w
instance MonadTrans (WriterT w) | Monoid w
where
liftT :: !(m b) -> WriterT w m b | Monoid w & Monad m
runWriterT :: (WriterT a u:b c) -> u:(b (c,a))
runWriterT :: !(WriterT a u:b c) -> u:(b (c,a))
writer :: .(.(a,b) -> WriterT b .Identity a)
runWriter :: .((WriterT a .Identity b) -> (b,a))
execWriter :: (WriterT a .Identity b) -> a
mapWriter :: u:((a,b) -> .(c,d)) -> v:((WriterT b .Identity a) -> WriterT d .Identity c), [v <= u]
execWriterT :: .(WriterT a b c) -> b a | Monad b
mapWriterT :: .(u:(a (b,c)) -> v:(d (e,f))) (WriterT c u:a b) -> WriterT f v:d e
execWriterT :: !.(WriterT a b c) -> b a | Monad b
mapWriterT :: !.(u:(a (b,c)) -> v:(d (e,f))) (WriterT c u:a b) -> WriterT f v:d e
tell :: a -> .(WriterT a b ()) | Monad b
listen :: .(WriterT a b c) -> .(WriterT a b (c,a)) | Monad b
pass :: .(WriterT a b (c,a -> d)) -> .(WriterT d b c) | Monad b
listens :: (a -> b) .(WriterT a c d) -> WriterT a c (d,b) | Monad c & Monoid a
censor :: (a -> b) .(WriterT a c d) -> .(WriterT b c d) | Monad c & Monoid a
listen :: !.(WriterT a b c) -> .(WriterT a b (c,a)) | Monad b
pass :: !.(WriterT a b (c,a -> d)) -> .(WriterT d b c) | Monad b
listens :: (a -> b) !.(WriterT a c d) -> WriterT a c (d,b) | Monad c & Monoid a
censor :: (a -> b) !.(WriterT a c d) -> .(WriterT b c d) | Monad c & Monoid a
......@@ -8,10 +8,6 @@ import Control.Monad.Trans
from StdFunc import o
from StdTuple import fst, snd
:: WriterT w m a = WriterT (m (a, w))
:: Writer w a :== WriterT w Identity a
instance Functor (WriterT w m) | Monad m & Monoid w where
fmap f m = liftM f m
......@@ -28,10 +24,12 @@ instance Monad (WriterT w m) | Monad m & Monoid w where
runWriterT (k a) >>= \(b, w`) ->
pure (b, mappend w w`))
instance MonadTrans (WriterT w) | Monoid w where
liftT m = WriterT (m >>= \a -> pure (a, mempty))
instance MonadTrans (WriterT w) | Monoid w
where
liftT :: !(m b) -> WriterT w m b | Monoid w & Monad m
liftT m = WriterT (m >>= \a -> pure (a, mempty))
runWriterT :: (WriterT a u:b c) -> u:(b (c,a))
runWriterT :: !(WriterT a u:b c) -> u:(b (c,a))
runWriterT (WriterT w) = w
writer :: .(.(a,b) -> WriterT b .Identity a)
......@@ -46,25 +44,25 @@ execWriter m = snd (runWriter m)
mapWriter :: u:((a,b) -> .(c,d)) -> v:((WriterT b .Identity a) -> WriterT d .Identity c), [v <= u]
mapWriter f = mapWriterT (Identity o f o runIdentity)
execWriterT :: .(WriterT a b c) -> b a | Monad b
execWriterT :: !.(WriterT a b c) -> b a | Monad b
execWriterT m = runWriterT m >>= \(_, w) -> pure w
mapWriterT :: .(u:(a (b,c)) -> v:(d (e,f))) (WriterT c u:a b) -> WriterT f v:d e
mapWriterT :: !.(u:(a (b,c)) -> v:(d (e,f))) (WriterT c u:a b) -> WriterT f v:d e
mapWriterT f m = WriterT (f (runWriterT m))
tell :: a -> .(WriterT a b ()) | Monad b
tell w = WriterT (pure ((), w))
listen :: .(WriterT a b c) -> .(WriterT a b (c,a)) | Monad b
listen :: !.(WriterT a b c) -> .(WriterT a b (c,a)) | Monad b
listen m = WriterT (runWriterT m >>= \(a, w) ->
pure ((a, w), w))
pass :: .(WriterT a b (c,a -> d)) -> .(WriterT d b c) | Monad b
pass :: !.(WriterT a b (c,a -> d)) -> .(WriterT d b c) | Monad b
pass m = WriterT (runWriterT m >>= \((a, f), w) ->
pure (a, f w))
listens :: (a -> b) .(WriterT a c d) -> WriterT a c (d,b) | Monad c & Monoid a
listens :: (a -> b) !.(WriterT a c d) -> WriterT a c (d,b) | Monad c & Monoid a
listens f m = listen m >>= \(a, w) -> pure (a, f w)
censor :: (a -> b) .(WriterT a c d) -> .(WriterT b c d) | Monad c & Monoid a
censor :: (a -> b) !.(WriterT a c d) -> .(WriterT b c d) | Monad c & Monoid a
censor f m = pass (m >>= \a -> pure (a, f))
......@@ -18,7 +18,7 @@ from System.File import :: FileError
* @param The message for which to compute the digest
* @return The ascii hex representation of the message digest
*/
md5 :: String -> String
md5 :: !String -> String
/**
* Compute the MD5 digest of a string
......@@ -26,7 +26,7 @@ md5 :: String -> String
* @param The message for which to compute the digest
* @return The raw 128 bit digest
*/
md5StringDigest :: String -> MD5Digest
md5StringDigest :: !String -> MD5Digest
/**
* Compute the MD5 digest of the contents of a file
......@@ -36,7 +36,7 @@ md5StringDigest :: String -> MD5Digest
* @return The raw 128 bit digest
* @return The environment
*/
md5FileDigest :: FilePath *env -> (!MaybeError FileError MD5Digest,!*env) | FileSystem env
md5FileDigest :: !FilePath !*env -> (!MaybeError FileError MD5Digest,!*env) | FileSystem env
/**
* Print an MD5 digest as ascii hexadecimal form
......
......@@ -6,7 +6,7 @@ implementation module Crypto.Hash.MD5
import StdEnv
import Data.Tuple, Text, System.FilePath, System.File, Data.Error, Data.Functor
md5 :: String -> String
md5 :: !String -> String
md5 msg = toString (md5StringDigest msg)
/* "the values of the integer part of 4294967296 times abs(sin(i))" */
......@@ -207,8 +207,8 @@ readResult :: (Int,Int,Int,Int) -> MD5Digest
readResult (x,y,z,zs)
= MD5Digest (join "" [{toChar (i >> (j * 8)) \\ j <- [0..3]} \\ i <- [x,y,z,zs]])
md5StringDigest :: String -> MD5Digest
md5StringDigest msg
md5StringDigest :: !String -> MD5Digest
md5StringDigest msg
# (result,buffer) = computeForString msg (0x67452301,0xefcdab89,0x98badcfe,0x10325476) ((size msg)*8) (createArray 16 0)
= result
......@@ -256,7 +256,7 @@ readS szoveg numberOfBits buffer
third = select text (index*4+2)
fourth = select text (index*4+3)
md5FileDigest :: FilePath *env -> (!MaybeError FileError MD5Digest,!*env) | FileSystem env
md5FileDigest :: !FilePath !*env -> (!MaybeError FileError MD5Digest,!*env) | FileSystem env
md5FileDigest path world
#!(ok,f,world)= fopen path FReadData world
|not ok
......
definition module Data.Tuple
from Data.Functor import class Functor
from Data.Monoid import class Semigroup, class Monoid
from Data.Foldable import class Foldable
from Data.Traversable import class Traversable
from Data.Bifunctor import class Bifunctor
tuple :: .a .b -> .(.a,.b)
tuple3 :: .a .b .c -> .(.a,.b,.c)
appFst :: .(.a -> .c) !(.a,.b) -> (.c,.b)
appSnd :: .(.b -> .c) !(.a,.b) -> (.a,.c)
appFst3 :: .(.a -> .d) !(.a,.b,.c) -> (.d,.b,.c)
appSnd3 :: .(.b -> .d) !(.a,.b,.c) -> (.a,.d,.c)
appThd3 :: .(.c -> .d) !(.a,.b,.c) -> (.a,.b,.d)
swap :: !.(.a, .b) -> .(.b, .a)
instance Functor ((,) a)
instance Functor ((,,) a b)
instance Functor ((,,,) a b c)
instance Functor ((,,,,) a b c d)
instance Functor ((,,,,,) a b c d e)
instance Semigroup (a, b) | Semigroup a & Semigroup b
where
mappend :: !(a,b) !(a,b) -> (a,b) | Semigroup a & Semigroup b
instance Semigroup (a, b, c) | Semigroup a & Semigroup b & Semigroup c
where
mappend :: !(a,b,c) !(a,b,c) -> (a,b,c) | Semigroup a & Semigroup b & Semigroup c
instance Semigroup (a, b, c, d) | Semigroup a & Semigroup b & Semigroup c & Semigroup d
where
mappend :: !(a,b,c,d) !(a,b,c,d) -> (a,b,c,d) | Semigroup a & Semigroup b & Semigroup c & Semigroup d
instance Semigroup (a, b, c, d, e) | Semigroup a & Semigroup b & Semigroup c & Semigroup d & Semigroup e
where
mappend :: !(a,b,c,d,e) !(a,b,c,d,e) -> (a,b,c,d,e) | Semigroup a & Semigroup b & Semigroup c & Semigroup d & Semigroup e
instance Monoid (a, b) | Monoid a & Monoid b
instance Monoid (a, b, c) | Monoid a & Monoid b & Monoid c
instance Monoid (a, b, c, d) | Monoid a & Monoid b & Monoid c & Monoid d
instance Monoid (a, b, c, d, e) | Monoid a & Monoid b & Monoid c & Monoid d & Monoid e
instance Foldable ((,) a)
instance Traversable ((,) a)
instance Bifunctor (,)
instance Bifunctor ((,,) x)
instance Bifunctor ((,,,) x y)
instance Bifunctor ((,,,,) x y z)
definition module Data.Tuple
from Control.Monad import class pure, class <*>, class Applicative
from Data.Functor import class Functor
from Data.Monoid import class Semigroup, class Monoid
from Data.Foldable import class Foldable
from Data.Traversable import class Traversable
from Data.Bifunctor import class Bifunctor
tuple :: .a .b -> .(.a,.b)
tuple3 :: .a .b .c -> .(.a,.b,.c)
appFst :: .(.a -> .c) !(.a,.b) -> (.c,.b)
appSnd :: .(.b -> .c) !(.a,.b) -> (.a,.c)
appFst3 :: .(.a -> .d) !(.a,.b,.c) -> (.d,.b,.c)
appSnd3 :: .(.b -> .d) !(.a,.b,.c) -> (.a,.d,.c)
appThd3 :: .(.c -> .d) !(.a,.b,.c) -> (.a,.b,.d)
swap :: !.(.a, .b) -> .(.b, .a)
instance Functor ((,) a)
instance Functor ((,,) a b)
instance Functor ((,,,) a b c)
instance Functor ((,,,,) a b c d)
instance Functor ((,,,,,) a b c d e)
instance Semigroup (a, b) | Semigroup a & Semigroup b
where
mappend :: !(a,b) !(a,b) -> (a,b) | Semigroup a & Semigroup b
instance Semigroup (a, b, c) | Semigroup a & Semigroup b & Semigroup c
where
mappend :: !(a,b,c) !(a,b,c) -> (a,b,c) | Semigroup a & Semigroup b & Semigroup c
instance Semigroup (a, b, c, d) | Semigroup a & Semigroup b & Semigroup c & Semigroup d
where
mappend :: !(a,b,c,d) !(a,b,c,d) -> (a,b,c,d) | Semigroup a & Semigroup b & Semigroup c & Semigroup d
instance Semigroup (a, b, c, d, e) | Semigroup a & Semigroup b & Semigroup c & Semigroup d & Semigroup e
where
mappend :: !(a,b,c,d,e) !(a,b,c,d,e) -> (a,b,c,d,e) | Semigroup a & Semigroup b & Semigroup c & Semigroup d & Semigroup e
instance Monoid (a, b) | Monoid a & Monoid b
instance Monoid (a, b, c) | Monoid a & Monoid b & Monoid c
instance Monoid (a, b, c, d) | Monoid a & Monoid b & Monoid c & Monoid d
instance Monoid (a, b, c, d, e) | Monoid a & Monoid b & Monoid c & Monoid d & Monoid e
instance Foldable ((,) a)
where
foldMap :: !(a -> b) !(c,a) -> b | Monoid b
foldr :: !(a -> .b -> .b) .b !(c,a) -> .b
instance Traversable ((,) a)
where
traverse :: !(a -> b c) !(d,a) -> b (d,c) | Applicative b
instance Bifunctor (,)
instance Bifunctor ((,,) x)
instance Bifunctor ((,,,) x y)
instance Bifunctor ((,,,,) x y z)
......@@ -92,9 +92,11 @@ where
instance Foldable ((,) a)
where
foldMap :: !(a -> b) !(c,a) -> b | Monoid b
foldMap f (_, y) = f y
fold x = foldMap id x
foldr :: !(a -> .b -> .b) .b !(c,a) -> .b
foldr f z (_, y) = f y z
foldr` f z0 xs = foldl f` id xs z0
where f` k x z = k (f x z)
......@@ -112,6 +114,7 @@ where
instance Traversable ((,) a)
where
traverse :: !(a -> b c) !(d,a) -> b (d,c) | Applicative b
traverse f (x, y) = tuple x <$> f y
instance Bifunctor (,)
......
......@@ -5,4 +5,4 @@ import Internet.HTTP
:: CGIOption = CGIOptStaticFallback Bool // If all request handlers fail, should the static file handler be tried (default False)
| CGIOptParseArguments Bool // Should the query and body of the request be parsed (default True)
startCGI :: [CGIOption] [((String -> Bool),(HTTPRequest *World-> (HTTPResponse,*World)))] *World -> *World
startCGI :: ![CGIOption] ![((String -> Bool),(HTTPRequest *World-> (HTTPResponse,*World)))] !*World -> *World
......@@ -16,7 +16,7 @@ CGI_HEADERS :== [ ("Content-Type","CONTENT_TYPE")
]
//Starts the CGI Wrapper
startCGI :: [CGIOption] [((String -> Bool),(HTTPRequest *World-> (HTTPResponse,*World)))] *World -> *World
startCGI :: ![CGIOption] ![((String -> Bool),(HTTPRequest *World-> (HTTPResponse,*World)))] !*World -> *World
startCGI options handlers world
# (console, world) = stdio world
# (ok,console) = freopen console FReadData
......
......@@ -42,7 +42,7 @@ from Data.Maybe import :: Maybe
| OperandHelpText String String [String]
//* Help text for an operand: the meta variable, a description, additional lines
showHelpText :: [HelpText] -> String
showHelpText :: ![HelpText] -> String
/**
* Types instantiating this class can be combined to form new parsers.
......@@ -54,14 +54,14 @@ where
* @param The option description
* @result The corresponding parser
*/
optParser :: (t opts) -> OptParser opts
optParser :: !(t opts) -> OptParser opts
/**
* The help text belonging to an option description.
* @param The option description
* @result The corresponding parser
*/
helpText :: (t opts) -> [HelpText]
helpText :: !(t opts) -> [HelpText]
/**
* Parse commnd line arguments.
......@@ -71,7 +71,7 @@ where
* @param The default settings
* @result Either a list of error/warning messages or the new settings object
*/
parseOptions :: (t opts) [String] opts -> MaybeError [String] opts | OptionDescription t
parseOptions :: !(t opts) ![String] !opts -> MaybeError [String] opts | OptionDescription t
/**
* Basic command line options
......@@ -102,4 +102,4 @@ instance OptionDescription Option
* function removes these inconsistencies that can arise from combining
* option descriptors together.
*/
cleanupHelpText :: [HelpText] -> [HelpText]
cleanupHelpText :: ![HelpText] -> [HelpText]
......@@ -26,7 +26,7 @@ where
(<|>) (Error e) (Error _) = Error e
(<|>) (Error _) r = r
showHelpText :: [HelpText] -> String
showHelpText :: ![HelpText] -> String
showHelpText help = join "\n" $ map show help
where
maxLeftWidth = maxList $ map leftWidth help
......@@ -43,7 +43,7 @@ where
show (OperandHelpText var help add) =
rpad var (maxLeftWidth + 2) ' ' +++ join "\n " [help:add]
parseOptions :: (t opts) [String] opts -> MaybeError [String] opts | OptionDescription t
parseOptions :: !(t opts) ![String] !opts -> MaybeError [String] opts | OptionDescription t
parseOptions p args opts = parse (optParser p) args defaultState opts
where
defaultState =
......@@ -59,7 +59,7 @@ where
instance OptionDescription Option
where
optParser :: (Option opts) -> OptParser opts
optParser :: !(Option opts) -> OptParser opts
optParser (Flag f upd _) = OptParser \args st opts -> case args of
[arg:args] | arg == f -> case st.operands_state of
NoOperandsSeenYet -> Just $ (\opts -> (opts,st,args)) <$> upd opts
......@@ -122,7 +122,7 @@ where
[OperandHelpText var help add:rest] -> [OperandHelpText var help (add ++ lines):rest]
[] -> []
cleanupHelpText :: [HelpText] -> [HelpText]
cleanupHelpText :: ![HelpText] -> [HelpText]
cleanupHelpText [oht=:OptionHelpText opts _ _ _:rest] = [oht:cleanupHelpText $ catMaybes $ map cleanup rest]
where
cleanup :: HelpText -> Maybe HelpText
......
......@@ -39,7 +39,7 @@ definition module System._Finalized
from System._Pointer import :: Pointer
:: Finalized a = Finalized !a !Finalizer
:: Finalized a = Finalized a !Finalizer
:: Finalizer = {finalizer_implementation :: !FinalizerT}
:: FinalizerT = DummyFinalizer !Int !Int !Int
......
......@@ -91,17 +91,17 @@ decodeString s a
decodeLastOctet dest
| s.[src_o + 2] == '='
// lose the last four obsolete bits (2*6-8b)
#! oct = (fromChar a.[toInt s.[src_o]] << 2) +
# oct = (fromChar a.[toInt s.[src_o]] << 2) +
(fromChar a.[toInt s.[src_o + 1]] >> 4)
#! dest & [dest_o] = toChar oct
# dest & [dest_o] = toChar oct
= dest
| s.[src_o + 3] == '='
#! oct = (fromChar a.[toInt s.[src_o]] << 10) +
(fromChar a.[toInt s.[src_o + 1]] << 4) +
(fromChar a.[toInt s.[src_o + 2]] >> 2)
// lose the last two obsolete bits (3*6-2*8b)
#! dest & [dest_o+1] = toChar oct
#! dest & [dest_o] = toChar (oct >> 8)
# dest & [dest_o+1] = toChar oct
# dest & [dest_o] = toChar (oct >> 8)
= dest
| otherwise = decodeCommonOctet dest src_o dest_o
decodeCommonOctet :: !*String !Int !Int -> *String
......@@ -110,9 +110,9 @@ decodeString s a
((fromChar a.[toInt (s.[src_o + 1])]) << 12) +
((fromChar a.[toInt (s.[src_o + 2])]) << 6) +
(fromChar a.[toInt (s.[src_o + 3])])
#! dest & [dest_o + 2] = toChar oct