arguments: none.
non-deterministic.
Apply any function in the hypothesis that returns the correct type.
Given:
f :: a -> b
_ :: b
running application
will produce:
f (_ :: a)
arguments: single reference.
deterministic.
Apply the given function from local scope.
Given:
f :: a -> b
_ :: b
running apply f
will produce:
f (_ :: a)
arguments: single reference.
deterministic.
Use the given term from the hypothesis, unifying it with the current goal
Given:
some_a_val :: a
_ :: a
running assume some_a_val
will produce:
some_a_val
arguments: none.
non-deterministic.
Use any term in the hypothesis that can unify with the current goal.
Given:
some_a_val :: a
_ :: a
running assumption
will produce:
some_a_val
arguments: none.
non-deterministic.
Repeatedly attempt to split, destruct, apply functions, and recurse in an attempt to fill the hole.
Given:
f :: a -> b
g :: b -> c
_ :: a -> c
running auto
will produce:
g . f
arguments: none.
deterministic.
Produce a hole for a two-parameter function, as well as holes for its arguments. The argument holes have the same type but are otherwise unconstrained, and will be solved before the function.
In the example below, the variable
a
is free, and will unify to the resulting extract from any subsequent tactic.
Given:
_ :: Int
running binary
will produce:
(_3 :: a -> a -> Int) (_1 :: a) (_2 :: a)
arguments: single reference.
deterministic.
Destruct the given term, recursing on every resulting binding.
Assume we're called in the context of a function
f.
Given:
x :: (a, a)
_
running cata x
will produce:
case x of
(a1, a2) ->
let a1_c = f a1
a2_c = f a2
in _
arguments: none.
deterministic.
Collapse every term in scope with the same type as the goal.
Given:
a1 :: a
a2 :: a
a3 :: a
_ :: a
running collapse
will produce:
(_ :: a -> a -> a -> a) a1 a2 a3
arguments: single reference.
deterministic.
Use the given data cosntructor.
Given:
_ :: Maybe a
running ctor Just
will produce:
Just (_ :: a)
arguments: single reference.
deterministic.
Pattern match on the argument.
Given:
a :: Bool
_
running destruct a
will produce:
case a of
False -> _
True -> _
arguments: none.
deterministic.
Pattern match on every function paramater, in original binding order.
Assume
a
andb
were bound viaf a b = _
.
Given:
a :: Bool
b :: Maybe Int
_
running destruct_all
will produce:
case a of
False -> case b of
Nothing -> _
Just i -> _
True -> case b of
Nothing -> _
Just i -> _
arguments: single reference.
deterministic.
Pattern match on the argument, and fill the resulting hole in with the same data constructor.
Only applicable when the type constructor of the argument is the same as that of the hole.
Given:
e :: Either a b
_ :: Either x y
running homo e
will produce:
case e of
Left a -> Left (_ :: x)
Right b -> Right (_ :: y)
arguments: single binding.
deterministic.
Construct a lambda expression, binding an argument with the given name.
Given:
_ :: a -> b -> c -> d
running intro aye
will produce:
\aye -> (_ :: b -> c -> d)
arguments: varadic binding.
deterministic.
Construct a lambda expression, using the specific names if given, generating unique names otherwise. When no arguments are given, all of the function arguments will be bound; otherwise, this tactic will bind only enough to saturate the given names. Extra names are ignored.
Given:
_ :: a -> b -> c -> d
running intros
will produce:
\a b c -> (_ :: d)
Given:
_ :: a -> b -> c -> d
running intros aye
will produce:
\aye -> (_ :: b -> c -> d)
Given:
_ :: a -> b -> c -> d
running intros x y z w
will produce:
\x y z -> (_ :: d)
arguments: varadic binding.
deterministic.
Create let-bindings for each binder given to this tactic.
Given:
_ :: x
running let a b c
will produce:
let a = _1 :: a
b = _2 :: b
c = _3 :: c
in (_4 :: x)
arguments: single reference.
non-deterministic.
Nest the given function (in module scope) with itself arbitrarily many times. NOTE: The resulting function is necessarily unsaturated, so you will likely need
with_arg
to use this tactic in a saturated context.
Given:
_ :: [(Int, Either Bool a)] -> [(Int, Either Bool b)]
running nested fmap
will produce:
fmap (fmap (fmap _))
arguments: none.
non-deterministic.
Produce a nullary data constructor for the current goal.
Given:
_ :: [a]
running obvious
will produce:
[]
arguments: tactic.
deterministic.
Restrict the hypothesis in the holes of the given tactic to align up with the top-level bindings. This will ensure, eg, that the first hole can see only terms that came from the first position in any terms destructed from the top-level bindings.
In the context of
f (a1, b1) (a2, b2) = _
. The resulting first hole can see only 'a1' and 'a2', and the second, only 'b1' and 'b2'.
Given:
_
running pointwise (use mappend)
will produce:
mappend _ _
arguments: none.
deterministic.
Fill the current hole with a call to the defining function.
In the context of
foo (a :: Int) (b :: b) = _
:
Given:
_
running recursion
will produce:
foo (_ :: Int) (_ :: b)
arguments: none.
deterministic.
"Solve" the goal by leaving a hole.
Given:
_ :: b
running sorry
will produce:
_ :: b
arguments: none.
non-deterministic.
Produce a data constructor for the current goal.
Given:
_ :: Either a b
running split
will produce:
Right (_ :: b)
arguments: tactic.
non-deterministic.
Simultaneously run and do not run a tactic. Subsequent tactics will bind on both states.
Given:
f :: a -> b
_ :: b
running try (apply f)
will produce:
-- BOTH of:
f (_ :: a)
-- and
_ :: b
arguments: none.
deterministic.
Produce a hole for a single-parameter function, as well as a hole for its argument. The argument holes are completely unconstrained, and will be solved before the function.
In the example below, the variable
a
is free, and will unify to the resulting extract from any subsequent tactic.
Given:
_ :: Int
running unary
will produce:
(_2 :: a -> Int) (_1 :: a)
arguments: single reference.
deterministic.
Apply the given function from module scope.
import Data.Char (isSpace)
Given:
_ :: Bool
running use isSpace
will produce:
isSpace (_ :: Char)
arguments: none.
deterministic.
Fill the current goal with a function application. This can be useful when you'd like to fill in the argument before the function, or when you'd like to use a non-saturated function in a saturated context.
Where
a
is a new unifiable type variable.
Given:
_ :: r
running with_arg
will produce:
(_2 :: a -> r) (_1 :: a)