‘toSample’ is not a (visible) method of class ‘ToSample’

130 views
Skip to first unread message

juan....@klarna.com

unread,
Feb 3, 2017, 2:07:48 PM2/3/17
to haskell-servant
Hey,

I'm trying to use servant-docs with a fairly simple example. Something like:

```
newtype User = User { username :: String }
  deriving (Eq, Show, Arbitrary, Generic)

instance ToJSON User

type AuthAPI = "user" :> Get '[JSON] User

instance ToSample User where
  toSample = Just g
    where g = User "john-doe"

api :: Proxy AuthAPI
api = Proxy

md :: String
md = markdown $ docs api
```

And I get 

```
.../src/AuthAPI.hs:23:3: error:
    ‘toSample’ is not a (visible) method of class ‘ToSample’
```

If it helps I'm using servant 0.8.1 and haskell2010. Any idea?
Reply all
Reply to author
Forward
0 new messages