Anonymous user
Object serialization: Difference between revisions
→{{header|Haskell}}
No edit summary |
|||
Line 990:
Example uses [https://hackage.haskell.org/package/binary <tt>binary</tt>] package. Since Haskell doesn't directly support OO-style inheritance, we use a sum type instead:
<lang haskell>{-# LANGUAGE DeriveGeneric #-}
module Main (main) where
Line 1,015 ⟶ 1,014:
bytes <- ByteString.readFile "objects.dat"
let employees = Binary.decode bytes
print (employees :: [Employee])</lang>
=={{header|Groovy}}==
|