Skip to content
Permalink
Browse files

Ouroboros.Byron.Point.Block is Bifunctor

  • Loading branch information...
avieth committed Jul 11, 2019
1 parent 10131a7 commit 3e512786f0d1b158b7b0d7cbdfe6672be4bc2978
Showing with 7 additions and 0 deletions.
  1. +7 −0 ouroboros-network/src/Ouroboros/Network/Point.hs
@@ -11,6 +11,7 @@ module Ouroboros.Network.Point
, block
) where

import Data.Bifunctor (Bifunctor (..))
import GHC.Generics (Generic)

data WithOrigin t = Origin | At t
@@ -22,6 +23,12 @@ data Block slot hash = Block
}
deriving (Eq, Ord, Show)

instance Bifunctor Block where
bimap f g blk = blk
{ blockPointSlot = f (blockPointSlot blk)
, blockPointHash = g (blockPointHash blk)
}

at :: t -> WithOrigin t
at = At

0 comments on commit 3e51278

Please sign in to comment.
You can’t perform that action at this time.