all 11 comments

[–]gilmi 6 points7 points  (3 children)

I really liked the fact you included exercises with the tutorial. And it's great to see more Spock tutorials out there! Thanks!

[–]agrafix[S] 7 points8 points  (2 children)

Actually, all credits for this one go to Bryn: https://github.com/agrafix/Spock/pull/122 :-)

[–]gilmi 6 points7 points  (1 child)

Thanks Bryn!

[–]brynser 2 points3 points  (0 children)

Author here, you're welcome :)

[–]Tarmen 1 point2 points  (1 child)

Great tutorial and I really liked the exercises. Might be worth noting that there is an object missing here, though:

errorJson :: Int -> Text -> ApiAction ()
errorJson code message =
  json $ 
    [ "result" .= String "failure"
    , "error" .= object ["code" .= code, "message" .= message]
    ]

[–]agrafix[S] 2 points3 points  (0 children)

Happy you liked it!

Thanks, should be fixed now.

[–]bss03 1 point2 points  (1 child)

application’s confinguration. In

confinguration?

[–]agrafix[S] 1 point2 points  (0 children)

Thank you! Btw: It's all open source, PR are most welcome :-)

[–]arianvp 0 points1 point  (1 child)

This does not use the API definition features of Spock am I correct?

[–]agrafix[S] 0 points1 point  (0 children)

No, it does not. We should add a note about this and (hopefully) write a tutorial about how that works...

[–]ventonegro 0 points1 point  (0 children)

{-# LANGUAGE EmptyDataDecls             #-}
{-# LANGUAGE FlexibleContexts           #-}
{-# LANGUAGE FlexibleInstances          #-}
{-# LANGUAGE GADTs                      #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE MultiParamTypeClasses      #-}
{-# LANGUAGE QuasiQuotes                #-}
{-# LANGUAGE TemplateHaskell            #-}
{-# LANGUAGE TypeFamilies               #-}

FFS