Guest User

Untitled

a guest
Nov 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. -- Use "uninterpreted" types to disallow pattern matching on constructors
  2. type Seq :: * -> * -> *
  3. type Tup :: * -> * -> *
  4.  
  5. -- This also doesn't work -- djinn treats them as Void
  6. -- data Seq a b
  7. -- data Tup a b
  8.  
  9. iden :: Seq a a
  10. comp :: Seq a b -> Seq b c -> Seq a c
  11. unit :: Seq a ()
  12. injl :: Seq a b -> Seq a (Either b c)
  13. injr :: Seq a c -> Seq a (Either b c)
  14. case :: Seq (Tup a c) d -> Seq (Tup b c) d -> Seq (Tup (Either a b) c) d
  15. pair :: Seq a b -> Seq a c -> Seq a (Tup b c)
  16. take :: Seq a c -> Seq (Tup a b) c
  17. drop :: Seq b c -> Seq (Tup a b) c
  18.  
  19. -- I'm trying to implement things like this
  20. f ? Seq (Tup a c0) (Tup b c0) -> Seq (Tup a c1) (Tup c c1) -> Seq (Tup a (Tup c0 c1)) (Tup (Tup b c) (Tup c0 c1))
  21. comp1 ? Seq (Tup a c0) (Tup b c0) -> Seq (Tup b c1) (Tup c c1) -> Seq (Tup a (Tup c0 c1)) (Tup c (Tup c0 c1))
  22.  
  23. -- djinn reports that iden' has a realizer, but iden'' does not
  24. iden' ? Seq a a
  25. iden'' ? Seq b b
Add Comment
Please, Sign In to add comment