I have been working out on the examples given out in this article for creating Lenses.
I created Lens
as stated in the article and the following is my code:
{-# LANGUAGE TemplateHaskell #-}
import Control.Lens
type Degrees = Double
type Latitude = Degrees
type Longitude = Degrees
data Meetup = Meetup { _name :: String, _location :: (Latitude, Longitude) }
makeLenses ''Meetup
meetupLat = location._1 :: Lens' Meetup Latitude
Now this code doesn't typecheck unless I include this:
{-# LANGUAGE NoMonomorphismRestriction #-}
But no where in the article, I could find out that they have mentioned about the monomorphism restriction. So is this an normal thing or am I doing something wrong here ?
Compiler used: GHC 7.6.2