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
132 | arrowImpl'
133 | (ts :< `(Control.Arrow.arrow {a = ~(pairTy $ MkAVar var ty :: strings), b = ~(pairTy strings')}
146 | arrowImpl'
153 | arrowImpl'
170 | pure (PatClause EmptyFC lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
194 | pure (PatClause EmptyFC lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
222 | pure (PatClause EmptyFC lhs $ mkEither i tot $ pair $ map name strings', Just $ composeImp $ optimize t)
243 | arrowImpl'
260 | arrowImplLam
266 | arrowImplLam
275 | `(Control.Arrow.arrow {a=_,b=_} (\_ => ~inp)) :< mor :< `(Control.Arrow.arrow {a=_,b=_} Builtin.snd)) [] rest
284 | arrowImpl'
290 | arrowImpl'
303 | ||| Enter arrow notation.
304 | |||
305 | ||| This elaboration script must be specifically invoked with
306 | ||| `%runElab`. The category is inferred from the return type.
307 | export