Skip to content

Commit b3edd1e

Browse files
committed
Define a prism for the Radar constructor.
1 parent a6f6dd9 commit b3edd1e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Starlight/Ship.hs

+5-1
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ module Starlight.Ship
99
, Component(..)
1010
) where
1111

12-
import Control.Lens (Lens')
12+
import Control.Lens (Lens', Prism')
1313
import Data.Functor.I
1414
import Data.Functor.Interval
1515
import Data.Generics.Product.Fields
16+
import Data.Generics.Sum.Constructors
1617
import GHC.Generics (Generic)
1718
import Starlight.Radar
1819
import UI.Colour
@@ -41,3 +42,6 @@ data Component
4142
| Radar Radar
4243
| Weapon
4344
deriving (Generic, Show)
45+
46+
_Radar :: Prism' Component Radar
47+
_Radar = _Ctor @"Radar"

0 commit comments

Comments
 (0)