From a3109f606802869efd9861d5dedf9bd2f528afc6 Mon Sep 17 00:00:00 2001 From: Gregory Gerasev Date: Wed, 29 May 2024 00:43:43 +0700 Subject: [PATCH] Add `HasSpine` instance for `Maybe` --- src-lib/data-spine/Data/Spine.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src-lib/data-spine/Data/Spine.hs b/src-lib/data-spine/Data/Spine.hs index 974167c..82ebcfa 100644 --- a/src-lib/data-spine/Data/Spine.hs +++ b/src-lib/data-spine/Data/Spine.hs @@ -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}