Commit f4c9e67b authored by Mart Lubbers's avatar Mart Lubbers

change all maybe's to builtin maybes

parent d89dd520
Pipeline #44667 passed with stage
in 2 minutes and 25 seconds
module IPLookup
import StdEnv
import IP, Maybe, CommandLine
import IP, ?, CommandLine
Start :: *World -> (String, *World)
Start world
# (cmd,world) = getCommandLine world
| length cmd <> 2 = ("Usage: " +++ cmd !! 0 +++ " hostname",world)
= case lookupIPAddress (cmd !! 1) world of
(Just addr, world) = (toString addr, world)
(Nothing, world) = ("Could not lookup IP address", world)
(?Just addr, world) = (toString addr, world)
(?None, world) = ("Could not lookup IP address", world)
......@@ -17,7 +17,7 @@ Start world
# (mWindir, world) = getEnvironmentVariable "windir" world
| isNothing mWindir = ("windir environment variable not found", world)
# editor = fromJust mWindir </> "notepad.exe"
# (res, world) = callProcess editor [textfile] Nothing world
# (res, world) = callProcess editor [textfile] ?None world
| isError res = ("Failed to run process: " +++ snd (fromError res), world)
# (res, world) = readFile textfile world
......
......@@ -16,8 +16,8 @@ helloPage req world
= ({newHTTPResponse & rsp_data = toString (page (name req))},world)
where
name req = case get "name" req.arg_get of
Nothing = "world"
(Just n) = n
?None = "world"
(?Just n) = n
page name = HtmlTag [] [head name,body name]
head name = HeadTag [] [TitleTag [] [Text "Hello ", Text name]]
body name = BodyTag [] [H1Tag [] [Text "Hello ", Text name]]
......
This diff is collapsed.
definition module PMDataModel
import Maybe
import ?
:: Employee = { employee_name :: String
, employee_description :: String
......@@ -12,7 +12,7 @@ import Maybe
:: Project = { project_projectNr :: Int
, project_description :: String
, project_parent :: (Maybe ProjectID)
, project_parent :: (? ProjectID)
, task_ofwhich_project :: [Task]
, project_ofwhich_parent :: [ProjectID]
......
implementation module PMDataModel
import Maybe
\ No newline at end of file
import ?
\ No newline at end of file
definition module PMDatabase
import StdEnv, Maybe
import StdEnv, ?
import SQL, MySQL
import PMDataModel
......@@ -9,4 +9,4 @@ initDatabase :: !String !String !String !String !*World -> (!*MySQLContext, !*My
endDatabase :: !*MySQLContext !*MySQLConnection !*MySQLCursor !*World -> *World
//Example of manually written database operation
updateProject :: Project !*cur -> (Maybe SQLError, *cur) | SQLCursor cur
updateProject :: Project !*cur -> (? SQLError, *cur) | SQLCursor cur
implementation module PMDatabase
import StdEnv, Maybe
import StdEnv, ?
import SQL, MySQL
import Text
......@@ -27,7 +27,7 @@ endDatabase context connection cursor world
= world
//Boring function we do no longer have to write
updateProject :: Project !*cur -> (Maybe SQLError, *cur) | SQLCursor cur
updateProject :: Project !*cur -> (? SQLError, *cur) | SQLCursor cur
updateProject project =: {Project | project_projectNr = pid} cursor
//Update the project record
# (mbErr,cursor) = execute "UPDATE project SET description = ?, parent = ? WHERE projectNr = ?" pvalues cursor
......@@ -44,13 +44,13 @@ updateProject project =: {Project | project_projectNr = pid} cursor
//Garbage collect tasks
# (mbErr,cursor) = execute ("DELETE FROM task WHERE project = ?" +++ tmatch ids) (tvalues ids) cursor
| isJust mbErr = (mbErr, cursor)
= (Nothing, cursor)
= (?None, cursor)
where
pvalues = [SQLVVarchar project.project_description, pparent project.project_parent, SQLVInteger project.Project.project_projectNr]
pparent Nothing = SQLVNull
pparent (Just {ProjectID| project_projectNr = x}) = SQLVInteger x
pparent ?None = SQLVNull
pparent (?Just {ProjectID| project_projectNr = x}) = SQLVInteger x
linkEmployees [] cursor = (Nothing, [], cursor)
linkEmployees [] cursor = (?None, [], cursor)
linkEmployees [{EmployeeID | employee_name = e}:es] cursor
# (mbErr, cursor) = execute "SELECT * FROM projectworkers WHERE project = ? AND employee = ?" [SQLVInteger pid, SQLVVarchar e] cursor
| isJust mbErr = (mbErr,[],cursor)
......@@ -68,7 +68,7 @@ where
ematch ids = " AND NOT (employee IN (" +++ (join "," ["?" \\ x <- ids]) +++ "))"
evalues ids = [SQLVInteger pid: map SQLVVarchar ids]
updateTasks [] cursor = (Nothing, [], cursor)
updateTasks [] cursor = (?None, [], cursor)
updateTasks [{Task | task_taskNr = taskNr, task_description = description, task_done = done}:ts] cursor
| taskNr == 0
# vals = [SQLVVarchar description, SQLVInteger (if done 1 0), SQLVInteger pid]
......
......@@ -11,8 +11,8 @@ where
labels = ["Project nr","Description","Parent project","Child projects", "Assigned employees"]
fields = [[Text (toString p.Project.project_projectNr)],[Text p.project_description],[parent],children,employees]
parent = case p.Project.project_parent of
Nothing = Text "-"
Just {ProjectID|project_projectNr = pid} = ATag [HrefAttr ("/projects/" +++ toString pid)] [Text (toString pid)]
?None = Text "-"
?Just {ProjectID|project_projectNr = pid} = ATag [HrefAttr ("/projects/" +++ toString pid)] [Text (toString pid)]
children = joinHtml (Text ", ") [ATag [HrefAttr ("/projects/" +++ toString pid)] [Text (toString pid)] \\ {ProjectID | project_projectNr = pid} <- p.project_ofwhich_parent]
employees = joinHtml (Text ", ") [ATag [HrefAttr ("/employees/" +++ name)] [Text name] \\ {EmployeeID | employee_name = name} <- p.projectworkers_employee_ofwhich_project]
tasks = makeTable ["Task Nr","Description","Done"] [[Text (toString t.Task.task_taskNr),Text t.Task.task_description, makeDoneIcon t.Task.task_done] \\ t <- p.task_ofwhich_project]
......@@ -41,9 +41,9 @@ where
,DivTag [ClassAttr "pm-addrow"] [ATag [HrefAttr "#", OnclickAttr "addTask(this);"] [ImgTag [SrcAttr "/icons/add.png", AltAttr "Remove"]],ATag [HrefAttr "#", OnclickAttr "addTask(this);"] [Text "Add another task"]]
]
parent = case project.project_parent of
Nothing = 0
Just {ProjectID| project_projectNr = x} = x
buttons = makeToolbar [makeLinkButton "Cancel" "." (Just "cross"), makeSubmitButton "Ok" (Just "tick")]
?None = 0
?Just {ProjectID| project_projectNr = x} = x
buttons = makeToolbar [makeLinkButton "Cancel" "." (?Just "cross"), makeSubmitButton "Ok" (?Just "tick")]
editProjectUpd :: (Map String String) -> Project
editProjectUpd args
......@@ -55,21 +55,21 @@ editProjectUpd args
# employees = get "projectworkers_employee_ofwhich_project" args
# employees = maybe [] (split "-") employees
# employees = [{EmployeeID | employee_name = name} \\ name <- employees | name <> ""]
# tasks = [ t \\ Just t <- map (makeTask pid args) (toList args)]
# tasks = [ t \\ ?Just t <- map (makeTask pid args) (toList args)]
= { project_projectNr = maybe 0 toInt (get "project_projectNr" args)
, project_description = maybe "" id (get "project_description" args)
, project_parent = if (parent <> 0) (Just {ProjectID| project_projectNr = parent}) Nothing
, project_parent = if (parent <> 0) (?Just {ProjectID| project_projectNr = parent}) ?None
, project_ofwhich_parent = children
, task_ofwhich_project = tasks
, projectworkers_employee_ofwhich_project = employees
}
where
makeTask :: Int (Map String String) (String,String) -> Maybe Task
makeTask :: Int (Map String String) (String,String) -> ? Task
makeTask pid args (name,value)
| name % (0,15) <> "task_description" = Nothing
| name % (0,15) <> "task_description" = ?None
# taskNr = toInt (name % (17,size name))
# done = isJust (get ("task_done-" +++ toString taskNr) args)
= Just ({Task | task_taskNr = (if (taskNr < 0) 0 taskNr), task_description = value, task_project = {ProjectID | project_projectNr = pid}, task_done = done})
= ?Just ({Task | task_taskNr = (if (taskNr < 0) 0 taskNr), task_description = value, task_project = {ProjectID | project_projectNr = pid}, task_done = done})
showEmployeeForm :: Employee -> HtmlTag
showEmployeeForm e = makeFormLayout (zip2 labels fields)
......@@ -83,7 +83,7 @@ editEmployeeForm :: Bool Employee [ProjectID] -> HtmlTag
editEmployeeForm create employee projects = makeForm (if create "+add" "+edit") [content, buttons]
where
content = makeFormLayout (zip2 labels fields)
buttons = makeToolbar [makeLinkButton "Cancel" "." (Just "cross"), makeSubmitButton "Ok" (Just "tick")]
buttons = makeToolbar [makeLinkButton "Cancel" "." (?Just "cross"), makeSubmitButton "Ok" (?Just "tick")]
labels = ["Name","Description","Works on projects"]
fields = [ if create [makeStringInput "employee_name" employee.Employee.employee_name] [SpanTag [] [Text employee.Employee.employee_name,makeHiddenInput "employee_name" employee.Employee.employee_name]]
, [makeStringInput "employee_description" employee.Employee.employee_description]
......
definition module PMHtml
import HTML, Maybe
import HTML, ?
makePage :: String String [HtmlTag] -> HtmlTag
makeForm :: String [HtmlTag] -> HtmlTag
......@@ -11,8 +11,8 @@ makeFormLayout :: [(String,[HtmlTag])] -> HtmlTag
makeFieldSet :: String [HtmlTag] -> HtmlTag
makeToolbar :: [HtmlTag] -> HtmlTag
makeLinkButton :: String String (Maybe String) -> HtmlTag
makeSubmitButton :: String (Maybe String) -> HtmlTag
makeLinkButton :: String String (? String) -> HtmlTag
makeSubmitButton :: String (? String) -> HtmlTag
makeIntInput :: String Int -> HtmlTag
makeBoolInput :: String Bool -> HtmlTag
......
implementation module PMHtml
import StdList
import HTML, Text, Maybe
import HTML, Text, ?
makePage :: String String [HtmlTag] -> HtmlTag
makePage title message content
......@@ -44,20 +44,20 @@ makeFieldSet title content
makeToolbar :: [HtmlTag] -> HtmlTag
makeToolbar content = DivTag [ClassAttr "pm-toolbar"] content
makeLinkButton :: String String (Maybe String) -> HtmlTag
makeLinkButton :: String String (? String) -> HtmlTag
makeLinkButton label href icon
= ButtonTag [OnclickAttr ("window.location='" +++ href +++ "'; return false;")] ((icontag icon)++ [Text label])
where
icontag Nothing = []
icontag (Just file) = [ImgTag [SrcAttr ("/icons/" +++ file +++ ".png")]]
icontag ?None = []
icontag (?Just file) = [ImgTag [SrcAttr ("/icons/" +++ file +++ ".png")]]
makeSubmitButton :: String (Maybe String) -> HtmlTag
makeSubmitButton :: String (? String) -> HtmlTag
makeSubmitButton label icon
= ButtonTag [TypeAttr "submit"] ((icontag icon)++ [Text label])
where
icontag Nothing = []
icontag (Just file) = [ImgTag [SrcAttr ("/icons/" +++ file +++ ".png")]]
icontag ?None = []
icontag (?Just file) = [ImgTag [SrcAttr ("/icons/" +++ file +++ ".png")]]
makeIntInput :: String Int -> HtmlTag
makeIntInput name value = InputTag [ClassAttr "pm-int",NameAttr name, ValueAttr (toString value), SizeAttr "4"]
......
......@@ -12,7 +12,7 @@ Start w
= case socket SocketStream w of
(Error e, w) = (Error e, w)
(Ok sockfd, w)
#! (merr, sockfd) = connect {ipv4_socket_port=8124,ipv4_socket_addr=Just (fromString "127.0.0.1")} sockfd
#! (merr, sockfd) = connect {ipv4_socket_port=8124,ipv4_socket_addr= ?Just (fromString "127.0.0.1")} sockfd
| isError merr = (liftError merr, w)
#! (merr, sockfd) = recv 128 [] sockfd
| isError merr = (merr, w)
......
......@@ -13,7 +13,7 @@ Start w
= case socket SocketStream w of
(Error e, w) = (Error e, w)
(Ok sockfd, w)
#! (merr, sockfd) = bind {ipv4_socket_port=8124,ipv4_socket_addr=Nothing} sockfd
#! (merr, sockfd) = bind {ipv4_socket_port=8124,ipv4_socket_addr= ?None} sockfd
| isError merr = (merr, w)
#! (merr, sockfd) = listen 3 sockfd
| isError merr = (merr, w)
......
......@@ -9,7 +9,6 @@ from StdOverloaded import class toString
from Data.Either import :: Either
from Data.GenDefault import generic gDefault
from Data.Maybe import :: Maybe
from Clean.Types import :: Type
......@@ -19,19 +18,19 @@ from Clean.Types import :: Type
*/
:: MultiLineString =: MultiLine String
class docDescription d :: !d -> Maybe Description
class docComplexity d :: !d -> Maybe String
class docDescription d :: !d -> ? Description
class docComplexity d :: !d -> ? String
class docParams d :: !d -> [ParamDoc]
class docVars d :: !d -> [Description]
class docResults d :: !d -> [Description]
class docType d :: !d -> Maybe Type
class docType d :: !d -> ? Type
class docThrows d :: !d -> [Description]
class docMembers d :: !d -> [Maybe ClassMemberDoc]
class docFields d :: !d -> Maybe [Maybe Description]
class docConstructors d :: !d -> Maybe [Maybe ConstructorDoc]
class docRepresentation d :: !d -> Maybe (Maybe Description)
class docMembers d :: !d -> [? ClassMemberDoc]
class docFields d :: !d -> ? [? Description]
class docConstructors d :: !d -> ? [? ConstructorDoc]
class docRepresentation d :: !d -> ? (? Description)
class docPropertyBootstrap d :: !d -> Maybe PropertyBootstrapDoc
class docPropertyBootstrap d :: !d -> ? PropertyBootstrapDoc
class docPropertyTestWith d :: !d -> [PropertyVarInstantiation]
class docPropertyTestGenerators d :: !d -> [PropertyTestGenerator]
class docProperties d :: !d -> [Property]
......@@ -41,8 +40,8 @@ class docPreconditions d :: !d -> [String]
* Documentation of a Clean module.
*/
:: ModuleDoc =
{ description :: !Maybe Description
, property_bootstrap :: !Maybe PropertyBootstrapDoc //* For generating unit tests with clean-test-properties
{ description :: !? Description
, property_bootstrap :: !? PropertyBootstrapDoc //* For generating unit tests with clean-test-properties
, property_test_with :: ![PropertyVarInstantiation] //* With which types to test the properties
, property_test_generators :: ![PropertyTestGenerator]
//* Functions to generate values of types for which Gast's {{`ggen`}} is not good enough, like {{`Map`}}
......@@ -65,12 +64,12 @@ derive gDefault ModuleDoc, PropertyBootstrapDoc
* Documentation of a Clean function.
*/
:: FunctionDoc =
{ description :: !Maybe Description
, complexity :: !Maybe String //* E.g. "O(n log n)"
{ description :: !? Description
, complexity :: !? String //* E.g. "O(n log n)"
, params :: ![ParamDoc] //* Descriptions of the parameters
, vars :: ![Description] //* Descriptions of the type variables (for generics)
, results :: ![Description] //* Descriptions of the result(s, for tuples)
, type :: !Maybe Type //* The type (for macros)
, type :: !? Type //* The type (for macros)
, throws :: ![Description] //* The exceptions it may throw (iTasks)
, properties :: ![Property] //* Properties of this function
, property_test_with :: ![PropertyVarInstantiation] //* With which types to test the properties
......@@ -92,8 +91,8 @@ instance docPreconditions FunctionDoc
* Documentation of a class instance.
*/
:: InstanceDoc =
{ description :: !Maybe Description
, complexity :: !Maybe String //* E.g. "O(n log n)"
{ description :: !? Description
, complexity :: !? String //* E.g. "O(n log n)"
, properties :: ![Property] //* Properties of this instance
, property_test_with :: ![PropertyVarInstantiation] //* With which types to test the properties
, preconditions :: ![String] //* Preconditions for the properties
......@@ -109,8 +108,8 @@ instance docPreconditions InstanceDoc
* Documentation of a function parameter.
*/
:: ParamDoc =
{ name :: !Maybe String //* An optional name for the parameter
, description :: !Maybe Description //* An optional description
{ name :: !? String //* An optional name for the parameter
, description :: !? Description //* An optional description
}
instance toString ParamDoc
......@@ -156,11 +155,11 @@ derive gDefault FunctionDoc, InstanceDoc, Property, PropertyVarInstantiation, Pr
* For an explanation of the fields, see the documentation on {{`FunctionDoc`}}.
*/
:: ClassMemberDoc =
{ description :: !Maybe Description
, complexity :: !Maybe String
{ description :: !? Description
, complexity :: !? String
, params :: ![ParamDoc]
, results :: ![Description]
, type :: !Maybe Type
, type :: !? Type
, throws :: ![Description]
}
......@@ -177,7 +176,7 @@ derive gDefault ClassMemberDoc
* For an explanation of the fields, see the documentation on {{`FunctionDoc`}}.
*/
:: ConstructorDoc =
{ description :: !Maybe Description
{ description :: !? Description
, params :: ![ParamDoc]
}
......@@ -189,9 +188,9 @@ derive gDefault ConstructorDoc
* Documentation of a Clean class.
*/
:: ClassDoc =
{ description :: !Maybe Description
{ description :: !? Description
, vars :: ![Description] //* The type variables
, members :: ![Maybe ClassMemberDoc] //* Documentation on the members
, members :: ![? ClassMemberDoc] //* Documentation on the members
}
instance docDescription ClassDoc
......@@ -203,11 +202,11 @@ derive gDefault ClassDoc
* Documentation of a Clean type.
*/
:: TypeDoc =
{ description :: !Maybe Description
{ description :: !? Description
, vars :: ![Description] //* Type variables
, representation :: !Maybe (Maybe Description) //* For synonym types
, fields :: !Maybe [Maybe Description] //* For records
, constructors :: !Maybe [Maybe ConstructorDoc] //* For ADTs
, representation :: !? (? Description) //* For synonym types
, fields :: !? [? Description] //* For records
, constructors :: !? [? ConstructorDoc] //* For ADTs
, invariants :: ![Property] //* For Gast test generation
}
......@@ -260,7 +259,7 @@ functionToClassMemberDoc :: !FunctionDoc -> ClassMemberDoc
* @param The documentation on the class member
* @result The new ClassDoc
*/
addClassMemberDoc :: !ClassDoc !(Maybe ClassMemberDoc) -> ClassDoc
addClassMemberDoc :: !ClassDoc !(? ClassMemberDoc) -> ClassDoc
/**
* Parse a single docstring, removing the asterisk and trimming whitespace.
......@@ -289,7 +288,7 @@ parseDoc :: !String -> Either ParseError (!d, ![ParseWarning]) | docBlockToDoc{|
generic docBlockToDoc d :: !(Either [String] DocBlock) -> Either ParseError (!d, ![ParseWarning])
derive docBlockToDoc UNIT, PAIR, EITHER, CONS, OBJECT, FIELD of {gfd_name}, RECORD
derive docBlockToDoc String, [], Maybe, Type
derive docBlockToDoc String, [], ?, Type
derive docBlockToDoc ModuleDoc, FunctionDoc, InstanceDoc, ClassMemberDoc,
ClassDoc, ConstructorDoc, TypeDoc
......
......@@ -31,7 +31,7 @@ from Clean.Types import :: Type, :: TypeRestriction, :: TypeContext
from Clean.Types.Parse import parseType
from Clean.Types.Util import instance toString Type
gDefault{|Maybe|} _ = Nothing
gDefault{|(?)|} _ = ?None
fromMultiLine :: !MultiLineString -> String
fromMultiLine (MultiLine s) = s
......@@ -82,8 +82,8 @@ instance docRepresentation TypeDoc where docRepresentation d = d.TypeDoc.represe
instance toString ParamDoc
where
toString pd=:{name=Just n,description=Just d} = n +++ ": " +++ d
toString {ParamDoc | description=Just d} = d
toString pd=:{name= ?Just n,description= ?Just d} = n +++ ": " +++ d
toString {ParamDoc | description= ?Just d} = d
toString _ = ""
derive gDefault Type, TypeRestriction, ModuleDoc, FunctionDoc, InstanceDoc, TypeContext,
......@@ -109,7 +109,7 @@ functionToClassMemberDoc d =
, throws = d.FunctionDoc.throws
}
addClassMemberDoc :: !ClassDoc !(Maybe ClassMemberDoc) -> ClassDoc
addClassMemberDoc :: !ClassDoc !(? ClassMemberDoc) -> ClassDoc
addClassMemberDoc d m = {d & members=d.members ++ [m]}
parseSingleLineDoc :: (String -> String)
......@@ -124,9 +124,9 @@ docBlockToDoc{|String|} (Left ss) = Right (trim $ last ss, [])
docBlockToDoc{|String|} _ = abort "error in docBlockToDoc{|String|}\n"
docBlockToDoc{|[]|} fx (Left ss) = (\vws -> (map fst vws, flatten (map snd vws)) ) <$> mapM fx (map (Left o pure) ss)
docBlockToDoc{|[]|} _ _ = abort "error in docBlockToDoc{|[]|}\n"
docBlockToDoc{|Maybe|} fx (Left []) = Right (Nothing, [])
docBlockToDoc{|Maybe|} fx ss=:(Left _) = appFst Just <$> fx ss
docBlockToDoc{|Maybe|} _ _ = abort "error in docBlockToDoc{|Maybe|}\n"
docBlockToDoc{|(?)|} fx (Left []) = Right (?None, [])
docBlockToDoc{|(?)|} fx ss=:(Left _) = appFst ?Just <$> fx ss
docBlockToDoc{|(?)|} _ _ = abort "error in docBlockToDoc{|(?)|}\n"
docBlockToDoc{|UNIT|} _ = Right (UNIT, [])
docBlockToDoc{|PAIR|} fx fy db=:(Right _) = liftA2 (\(x,ws) (y,ws`) -> (PAIR x y, ws ++ ws`)) (fx db) (fy db)
docBlockToDoc{|PAIR|} _ _ _ = abort "error in docBlockToDoc{|PAIR|}\n"
......@@ -162,23 +162,23 @@ docBlockToDoc{|MultiLineString|} (Left [s]) = Right (MultiLine (trimMultiLine $
docBlockToDoc{|MultiLineString|} _ = abort "error in docBlockToDoc{|MultiLineString|}\n"
docBlockToDoc{|ParamDoc|} (Left [s]) = case findName (fromString s) of
Just (name,rest) -> Right (
{ name = Just $ toString name
?Just (name,rest) -> Right (
{ name = ?Just $ toString name
, description = case rest of
[] -> Nothing
_ -> Just $ toString rest
[] -> ?None
_ -> ?Just $ toString rest
}, [])
_ -> Right ({name=Nothing, description=Just s}, [])
_ -> Right ({name= ?None, description= ?Just s}, [])
where
findName cs
# (name,cs) = span (\c -> isAlphanum c || c == '`') cs
| not (isEmpty name) && not (isEmpty cs) && hd cs == ':'
= Just (toString name, dropWhile isSpace (tl cs))
= Nothing
= ?Just (toString name, dropWhile isSpace (tl cs))
= ?None
docBlockToDoc{|ParamDoc|} _ = abort "error in docBlockToDoc{|ParamDoc|}\n"
docBlockToDoc{|Type|} (Left []) = Left InternalNoDataError
docBlockToDoc{|Type|} (Left ss) = case [v \\ Just v <- map (parseType o fromString) ss] of
docBlockToDoc{|Type|} (Left ss) = case [v \\ ?Just v <- map (parseType o fromString) ss] of
[] -> Left (UnknownError "no parsable type")
vs -> Right (last vs, [])
docBlockToDoc{|Type|} _ = abort "error in docBlockToDoc{|Type|}\n"
......@@ -222,8 +222,8 @@ where
skipSpaces = pMany (pSatisfy isSpace) *> pYield undef
pTypeWithColonOrSemicolon = (pMany (pSatisfy \c -> c <> ':' && c <> ';') <* pOneOf [':;'])
>>= \t -> case parseType t of
Nothing -> pError "type could not be parsed"
Just t -> pure t
?None -> pError "type could not be parsed"
?Just t -> pure t
parseProperty :: ![String] -> Either ParseError (!String, ![ParseWarning])
parseProperty ss = Right (trimMultiLine ss, [])
......@@ -231,18 +231,18 @@ docBlockToDoc{|Property|} _ = abort "error in docBlockToDoc{|Property|}\n"
docBlockToDoc{|PropertyVarInstantiation|} (Left [s]) = case split "=" s of
[var:type:[]] -> case parseType (fromString type) of
Just t -> Right (PropertyVarInstantiation (trim var, t), [])
Nothing -> Left