10 | %language ElabReflection
44 | -- If a hole is found, always include every possible variable
72 | export
77 | where
81 | optimize (ts :< `(Control.Arrow.arrow {a = ~a, b = ~_} ~f) :< `(Control.Arrow.arrow {a = ~b, b = ~c} ~g)) =
82 | assert_total $ optimize (ts :< `(Control.Arrow.arrow {a = ~a, b = ~c} (Prelude.(.) {a = ~a, b = ~b, c = ~c} ~g ~f)))
89 | `(Control.Category.Core.(.)
104 | stringBind [(v,b)] = if b then IBindVar EmptyFC (UN $ Basic v.name) else Implicit EmptyFC True
105 | stringBind ((v,b) :: strings) = `(Builtin.MkPair ~(if b then IBindVar EmptyFC (UN $ Basic v.name) else Implicit EmptyFC True) ~(stringBind strings))
110 | stringLam [(v,True)] t = ILam EmptyFC MW ExplicitArg (Just $ UN $ Basic v.name) (Implicit EmptyFC False) t
136 | arrowImpl'
137 | (ts :< `(Control.Arrow.arrow {a = ~(pairTy $ MkAVar var ty :: strings), b = ~(pairTy strings')}
158 | pure (PatClause fc' lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
183 | pure (PatClause fc' lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
206 | pure (PatClause fc' lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
233 | pure (PatClause fc' lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
254 | arrowImpl'
271 | arrowImplLam
277 | arrowImplLam
297 | arrowImpl'
303 | arrowImpl'
321 | ||| Enter arrow notation.
322 | |||
323 | ||| This elaboration script must be specifically invoked with
324 | ||| `%runElab`. The category is inferred from the return type.
325 | export