In the acid state, exactly what $ means (deriveSafeCopy 0 'base' 'T)

In order for Acid to save values โ€‹โ€‹of type T, you need to write

$(deriveSafeCopy 0 'base ''T) 

after defining T. But what exactly does this command do?

+4
source share
1 answer

Disclaimer: I have never used Acid-state. But I know how to read documents :)

Data.SafeCopy docs talk about deriveSafeCopy :

Fetch a SafeCopy instance.

Absolutely straight, really. You get an instance of the class.

The docs talk about SafeCopy typeclass:

The central part of this library. Defines the version for the data type along with how it should be serialized / parsed.

So you go. This command apparently gets some (de) serialization functions that let you store your data type. "Safely".

+2
source

Source: https://habr.com/ru/post/1382939/


All Articles