Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Scotty + Aeson + Persistentで作るJSON Web API

Scotty + Aeson + Persistentで作るJSON Web API

Fujimura Daisuke

July 07, 2012
Tweet

More Decks by Fujimura Daisuke

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ • ౻ଜେհ • http://fujimuradaisuke.com @ffu_ • גࣜձࣾAimingॴଐ • Haskell޷͖ͷRuby

    on RailsϓϩάϥϚʔ • ࠷ۙ͸JavaScript/CoffeeScript΋Α͘ॻ͍͍ͯΔ • ΞδΞͷྉཧͱΞϝϦΧͷϏʔϧɺΞϧβεͷϫΠϯ͕޷͖ • ϥςϯΞϝϦΧจֶ΋޷͖
  2. ͱ͜ΖͰɺͳͥࠓJSON Web APIͳͷ͔ • ͳΜ͔ͩ࠷ۙJSON Web APIΛ࡞Δػձ͕ଟ͍ • ҰͭͷΞϓϦέʔγϣϯΛෳ਺ΫϥΠΞϯτͰಈ͔͢ࣄྫ͕૿͖͑ͯͨ •

    Mobile, PC, iOS/Android Nativeશ෦ʹల։ͱ͔ • ϑϩϯτΤϯυͰUIΛߏங͢Δٕज़ͷൃୡɾਁಁ • ΫϥΠΞϯτɾαʔόʔͷ෼ۀ͸ਐΈͦ͏
  3. persistentʹ͍ͭͯ • ͝ଘ஌YesodಉࠝͷORM • (͔͠͠ɺ”Object”ʹϚοϐϯά͞ΕͯΔؾ഑͸શ͘ແ͍ʣ • http://www.yesodweb.com/book/persistent • PostgreSQL, SQLite,

    MongoDB, MySQLʹରԠ • QuasiQuoteͰςʔϒϧఆٛɺϚΠάϨʔγϣϯ΋͋Δ • ܕνΣοΫ෇͖ͷSQLͬͯײ͡Ͱ࢖͍΍͍͢
  4. ༨ஊ • ͪͳΈʹҐஔ৘ใܥͷWebαʔϏεΛ࡞Ζ͏ͱͯ͠·ͨ͠ • ΫϥΠΞϯτ͸Backbone.js, CoffeeScriptɺGoogle Maps͋ͨΓΛར༻ • ࣮ࡍͷͱ͜ΖɺΫϥΠΞϯτͷίʔυΛॻ͍ͯΔํ͕௕͔ͬͨ… •

    HTMLςϯϓϨʔτ͸mustacheΛ࢖ͬͨɻ͜Ε΋ྑ͔ͬͨ • ·ͩෳࡶͳ͜ͱΛ΍ͬͯͳ͍ͷͰɺམͱ͕݀͋͠Γͦ͏ • ೝূ·ΘΓ͸·ͩະணखɻམͱ݀͠͸͔͜͜…ʁ • Template HaskellΛ࢖ͬͨΒToJSON/FromJSONʹ͢Δͷ΋ࣗಈͰͰ͖ͦ͏ͳ ؾ͕…