Skip to content

Commit

Permalink
Adding terminal function to Product.
Browse files Browse the repository at this point in the history
  • Loading branch information
roconnor committed Apr 7, 2012
1 parent a970a81 commit 6b825b5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Control/Category/Product.hs
Expand Up @@ -21,6 +21,8 @@ class Tensor c => Product c where
-- requires (f &&& g) . h === (f . h) &&& (g . h)
-- and (fst &&& snd) === id
(&&&) :: c x y -> c x z -> c x (y, z)
terminal :: c x ()

instance Product (->) where
(&&&) f g x = (f x, g x)
terminal _ = ()

0 comments on commit 6b825b5

Please sign in to comment.