Verified Commit 9b7cc134 authored by Camil Staps's avatar Camil Staps 🚀

Add strictness annotations

parent 2b218a3b
......@@ -4,7 +4,7 @@ from Data.Error import :: MaybeErrorString, :: MaybeError
from Regex import :: Regex
class toRegexInput a :: a -> [Char]
class toRegexInput a :: !a -> [Char]
instance toRegexInput [Char]
instance toRegexInput String
......@@ -12,10 +12,10 @@ instance toRegexInput String
/**
* Compile a regular expression.
*/
compile :: a -> MaybeErrorString Regex | toRegexInput a
compile :: !a -> MaybeErrorString Regex | toRegexInput a
/**
* Alternative to {{`compile`}} for hard-coded regular expressions.
* It gives a runtime error if {{`compile`}} fails with {{`Error`}}.
*/
regex :: a -> Regex | toRegexInput a
regex :: !a -> Regex | toRegexInput a
......@@ -42,10 +42,10 @@ where
concat [|r:rs] = [|r:concat rs]
concat [|] = [|]
regex :: a -> Regex | toRegexInput a
regex :: !a -> Regex | toRegexInput a
regex s = fromOk $ compile s
compile :: a -> MaybeErrorString Regex | toRegexInput a
compile :: !a -> MaybeErrorString Regex | toRegexInput a
compile cs = compile` 0 [|] (toRegexInput cs)
where
compile` :: Int [!Regex!] [Char] -> MaybeErrorString Regex
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment