Skip to content

Commit

Permalink
Add HasSpine instance for Maybe
Browse files Browse the repository at this point in the history
  • Loading branch information
uhbif19 committed May 28, 2024
1 parent f84fa6c commit a3109f6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src-lib/data-spine/Data/Spine.hs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ class
type Spine sop
getSpine :: sop -> Spine sop

-- instance (SingI sop1, SingI sop2) => SingI (sop1, sop2) where

instance (HasSpine sop1, HasSpine sop2) => HasSpine (sop1, sop2) where
type Spine (sop1, sop2) = (Spine sop1, Spine sop2)
getSpine (d1, d2) = (getSpine d1, getSpine d2)

-- TODO: mkOfSpine, using Sing
instance (HasSpine sop) => HasSpine (Maybe sop) where
type Spine (Maybe sop) = Maybe (Spine sop)
getSpine = fmap getSpine

-- | Newtype encoding sop value of fixed known spine
newtype OfSpine (x :: Spine datatype) = UnsafeMkOfSpine {getValue :: datatype}
Expand Down

0 comments on commit a3109f6

Please sign in to comment.