
I just released a library on hackage (https://hackage.haskell.org/package/apis-0.0.0). The goal of the library is to provide typesafe API calls to a large amount of existing APIs. By typesafe I mean that, for each API the library provides two types, Input and Output, and a function :: Input -> IO Output. Internally the library knows how to serialize Input to make an HTTP request and how to deserialize the response into Output. Whats cool about this library is that it uses Template Haskell to generate the API interfaces. A combination of Open Data Tables, an internal YQL engine and JSON Schemas, all written in Haskell makes this possible. Right now only two APIs are included (Swedish weather data and Swedish public announcement), but more APIs are soon to follow. I have also implemented FFI exports of all types and functions so that, in combination with SWIG, this library can be used in almost any language. So far I have tried Java and Python with success. If anyone would like to try it and respond with feedback it would be greatly appreciated! If you want any specific API supported, I can try to import that right away Fabian Bergmark

Hi reading the paragraph Am Freitag, den 12.12.2014, 17:01 +1000 schrieb Fabian Bergmark:
I just released a library on hackage (https://hackage.haskell.org/package/apis-0.0.0). The goal of the library is to provide typesafe API calls to a large amount of existing APIs. By typesafe I mean that, for each API the library provides two types, Input and Output, and a function :: Input -> IO Output. Internally the library knows how to serialize Input to make an HTTP request and how to deserialize the response into Output.
made me feel old, as I first didn’t get what this was about, then started to wonder why HTTP appears in a message about application programming interfaces, and then noticed that this seems to be talking about “Web-APIs”, which seem to be normal kind of APIs these days... Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • http://www.joachim-breitner.de/ Jabber: nomeata@joachim-breitner.de • GPG-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

I'm not old either. This should clarify REST APIs. Haskell has type-safe API calls out of the box. Joachim Breitner writes:
Hi
reading the paragraph
Am Freitag, den 12.12.2014, 17:01 +1000 schrieb Fabian Bergmark:
I just released a library on hackage (https://hackage.haskell.org/package/apis-0.0.0). The goal of the library is to provide typesafe API calls to a large amount of existing APIs. By typesafe I mean that, for each API the library provides two types, Input and Output, and a function :: Input -> IO Output. Internally the library knows how to serialize Input to make an HTTP request and how to deserialize the response into Output.
made me feel old, as I first didn’t get what this was about, then started to wonder why HTTP appears in a message about application programming interfaces, and then noticed that this seems to be talking about “Web-APIs”, which seem to be normal kind of APIs these days...
Greetings, Joachim
-- Kyle Marek-Spartz

On 2014-12-12 10:22 AM, Kyle Marek-Spartz wrote:
I'm not old either. This should clarify REST APIs. Haskell has type-safe API calls out of the box.
I second lengthening the name and description to "type-safe web REST APIs", but my angle is different. You want to future-proof its name and description against some new future kind of APIs you and I have never dreamed of.

I have updated the package description on hackage.
Does the package build correctly for you who have tried it? I think
GHC ~ 7.8.3 is required because of PatternSynonyms in the ecma262
package.
For you who try to add your own APIs, please email any bugs you
encounter. The YQL engine is built on top of my ecma262 package which
is incomplete. The core language should work, but specification
functions such as Array.push etc. are left unimplemented for now.
2014-12-13 6:02 GMT+10:00 Albert Y. C. Lai
On 2014-12-12 10:22 AM, Kyle Marek-Spartz wrote:
I'm not old either. This should clarify REST APIs. Haskell has type-safe API calls out of the box.
I second lengthening the name and description to "type-safe web REST APIs", but my angle is different. You want to future-proof its name and description against some new future kind of APIs you and I have never dreamed of.
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (4)
-
Albert Y. C. Lai
-
Fabian Bergmark
-
Joachim Breitner
-
Kyle Marek-Spartz