WIP: co-de bruijn #12
1 changed files with 11 additions and 0 deletions
|
@ -3,6 +3,7 @@ module Quox.Thin.View
|
||||||
import public Quox.Thin.Base
|
import public Quox.Thin.Base
|
||||||
import Quox.NatExtra
|
import Quox.NatExtra
|
||||||
import Data.Singleton
|
import Data.Singleton
|
||||||
|
import Data.SnocVect
|
||||||
|
|
||||||
%default total
|
%default total
|
||||||
|
|
||||||
|
@ -90,3 +91,13 @@ export
|
||||||
view (Keep {mask} ope eq) = KeepV mask ope
|
view (Keep {mask} ope eq) = KeepV mask ope
|
||||||
viewKeep ope eq with (view (Keep ope eq))
|
viewKeep ope eq with (view (Keep ope eq))
|
||||||
viewKeep ope Refl | KeepV _ ope = Refl
|
viewKeep ope Refl | KeepV _ ope = Refl
|
||||||
|
|
||||||
|
|
||||||
|
namespace SnocVect
|
||||||
|
export
|
||||||
|
select : {n, mask : Nat} -> (0 ope : OPE m n mask) ->
|
||||||
|
SnocVect n a -> SnocVect m a
|
||||||
|
select ope sx with (view ope)
|
||||||
|
select _ [<] | StopV = [<]
|
||||||
|
select _ (sx :< x) | DropV _ ope = select ope sx
|
||||||
|
select _ (sx :< x) | KeepV _ ope = select ope sx :< x
|
||||||
|
|
Loading…
Reference in a new issue