on master help sign in
Merge pull request #2320 from LeifW/hvect_get_implicit

Hvect get implicit

commit6a6d0d638f2b83566de055390fda06ee9506dcc3 authorDavid Christiansen <david@davidchristiansen.dk> dateThu 28 May 2015, 10:38 (11 years ago) parentf16051d60ace3d
2 files changed+6−8
libs/base/Data/HVect.idr+4−4 libs/effects/Effects.idr+2−4
libs/base/Data/HVect.idr+4−4
@@ -1,7 +1,7 @@
11module Data.HVect
22
33import Data.Fin
4−import Data.Vect
4+import public Data.Vect
55
66%access public
77%default total
@@ -56,17 +56,17 @@ instance (Shows k ts) => Show (HVect ts) where
5656
5757||| Extract an arbitrary element of the correct type.
5858||| @ t the goal type
59−get : {default tactics { search 100; } p : Elem t ts} -> HVect ts -> t
59+get : {auto p : Elem t ts} -> HVect ts -> t
6060get {p = Here} (x::xs) = x
6161get {p = There p'} (x::xs) = get {p = p'} xs
6262
6363||| Replace an element with the correct type.
64−put : {default tactics { search 100; } p : Elem t ts} -> t -> HVect ts -> HVect ts
64+put : {auto p : Elem t ts} -> t -> HVect ts -> HVect ts
6565put {p = Here} y (x::xs) = y :: xs
6666put {p = There p'} y (x::xs) = x :: put {p = p'} y xs
6767
6868||| Update an element with the correct type.
69−update : {default tactics { search 100; } p : Elem t ts} -> (t -> u) -> HVect ts -> HVect (replaceByElem ts p u)
69+update : {auto p : Elem t ts} -> (t -> u) -> HVect ts -> HVect (replaceByElem ts p u)
7070update {p = Here} f (x::xs) = f x :: xs
7171update {p = There p'} f (x::xs) = x :: update {p = p'} f xs
7272
libs/effects/Effects.idr+2−4
@@ -293,15 +293,13 @@ syntax MkDefaultEnv = with Env
293293
294294call : {a, b: _} -> {e : Effect} ->
295295 (eff : e t a b) ->
296− {default tactics { search 100; }
297− prf : EffElem e a xs} ->
296+ {auto prf : EffElem e a xs} ->
298297 EffM m t xs (\v => updateResTy v xs prf eff)
299298call e {prf} = callP prf e
300299
301300implicit
302301lift : EffM m t ys ys' ->
303− {default tactics { search 100; }
304− prf : SubList ys xs} ->
302+ {auto prf : SubList ys xs} ->
305303 EffM m t xs (\v => updateWith (ys' v) xs prf)
306304lift e {prf} = liftP prf e
307305