... | ... | @@ -15,6 +15,7 @@ If we want to refactor to change the internal representation of this maybe-like |
|
|
module Main where
|
|
|
|
|
|
import Internal ( A(..))
|
|
|
...more stuff using MkA...
|
|
|
|
|
|
-- Internal.hs
|
|
|
module Internal where
|
... | ... | @@ -29,7 +30,7 @@ If we modify `Internal.hs` as follows |
|
|
{-# LANGUAGE PatternSynonyms #-}
|
|
|
module Internal where
|
|
|
|
|
|
newtype A = NewA (Just Int)
|
|
|
newtype A = NewA (Maybe Int)
|
|
|
|
|
|
pattern MkA n = A (Just n)
|
|
|
|
... | ... | |