r/purescript • u/tuxkimo • Mar 14 '16
Announcing purescript-localstorage - alpha testers appreciated :-)
https://pursuit.purescript.org/packages/purescript-localstorage/0.1.2
Typesafe local storage, with a minimum amount of boilerplate.
I just finished it, it compiles and the basic example in test/Main.purs works, otherwise it is completely untested.
Enjoy! (Bug reports welcome!)
10
Upvotes
1
u/liberalogica Mar 21 '16
How does it compare with
purescript-typesafe-localstorage?1
u/liberalogica Mar 24 '16
If i get this right, there is an extra bit of safety provided by the main interface, where keys get associated to their values at the type level.
When trying to use this, i am not really interested in this kind of type safety at the moment, so i am tempted to just use the
Rawmodule. What do you think, would it make sense to expose also that lower level interface? I don't find other packages in Pursuit providing it2
u/liberalogica Mar 21 '16
If you are interested in Localstorage, you are probably also interested in this http://pouchdb.com/. I find it terrific, check it out :)
1
u/liberalogica Mar 24 '16
I don't understand the type level juggling with keys. I see that deriving the values from a generic data type allows you to do JSON serialisation and deserialisation under the curtains, but why cannot a key be a simple string? What do the types in the example buy us?