Generalized newtype deriving error

I need a generalized newtype declaration, and I’m trying to apply for this the appropriate language option, still get an error:

image

 Unexpected type ‘{getAge : Int}’
    In the newtype declaration for ‘Age’
    A newtype declaration should have form
      newtype Age a = ...parser

What am I missing?

I think you want to write

newtype Age = Age {getAge: Int} 
    deriving (Eq, Ord, Show, Enum)
1 Like

Of course, thanks!