SEPLAL77TB3T7FLHDDUQVJ6HOMWHV7AULLVCKUYUOZYNA5T7WO2QC
TB2E4KDQUMJPFAAM52B5SXRUBMETENQTLF5ZHRI3EG3DGAYQK7NQC
4QPDDW46NZLFA2GZ4YFOLEMHHP5BPHLBOTSZMOJ3UMGRQ4DH3N7QC
CQUB2A3OVJACRIRDLZNAO6XTFJX45ZNUJQU57A3Q4O6L6BT5ULIAC
{-# LANGUAGE TemplateHaskell #-}
-- * Prisms , _IndexItem
-- * Prisms
, _IndexItem
import Control.Lens.TH
type IndexItem = (Primer, NonEmptyList Location)
newtype IndexItem = IndexItem (Primer, NonEmptyList Location)$(makePrisms ''IndexItem)
newtype IndexItem = IndexItem (Primer, NonEmptyList Location)
$(makePrisms ''IndexItem)
singleton x y = [(x, NonEmptyList.singleton y)]
singleton x y = [IndexItem (x, NonEmptyList.singleton y)]
addLocation primer location [] = [(primer, NonEmptyList.singleton location)]
addLocation primer location [] = [IndexItem (primer, NonEmptyList.singleton location)]
| x ^. _1 . volume == primer ^. volume = (x & _2 %~ NonEmptyList.push location):xs
| x ^. _IndexItem . _1 . volume == primer ^. volume = (x & _IndexItem . _2 %~ NonEmptyList.push location):xs