Skip to content

Commit d5cf142

Browse files
committed
Add a Newtype instance to StatusCode
Makes it easier for users of the library to access the underlying statuscode with `unwrap`.
1 parent 6c59582 commit d5cf142

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: src/Affjax/StatusCode.purs

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
module Affjax.StatusCode where
22

33
import Prelude
4+
import Data.Newtype (class Newtype)
45

56
newtype StatusCode = StatusCode Int
67

78
derive instance eqStatusCode :: Eq StatusCode
89
derive instance ordStatusCode :: Ord StatusCode
10+
derive instance newtypeStatusCode :: Newtype StatusCode _
911

1012
instance showStatusCode :: Show StatusCode where
1113
show (StatusCode code) = "(StatusCode " <> show code <> ")"

0 commit comments

Comments
 (0)