What does the ! in { addressCity :: !Text } mean?

Viewed 86
1 Answers

It's a strictness annotation. Data constructor fields with an ! will be strictly evaluated.

Another place you often see this is when using the BangPatterns language extension. You can cause the function to strictly evaluate by annotating the parameter with an ! e.g.

foo :: Num a => a -> b
foo !a = ((++) a 1)
Related