from Hacker News

Rolling Your Own Blockchain in Haskell

by nicolast on 8/20/17, 3:11 PM with 32 comments

  • by lambdaxdotx on 8/20/17, 3:36 PM

    Here is another "minimum viable" blockchain implementation in Haskell: https://github.com/adjoint-io/nanochain.

    It's a bit simpler in implementation; the relevant data structures are defined a bit differently, so it could give a nice alternate perspective about what a blockchain written in Haskell may look like.

  • by qaezel on 8/21/17, 10:49 AM

  • by umen on 8/20/17, 5:58 PM

    Great stuff , where can I learn about blackchain in begginers level with code examples ?
  • by ngcc_hk on 8/20/17, 11:00 PM

    any other language? Python and lisp would be interesting.
  • by alphaalpha101 on 8/20/17, 10:01 PM

    I like the idea behind this article, but this isn't the way to do it. It hides the simplicity of the blockchain concept behind arcane syntax and overly complicated higher-order typing constructs.

        newtype BlockF a = Block (V.Vector a) deriving (Eq, Show, Foldable, Traversable, Functor, Monoid)
        type Block = BlockF Transaction
    
        type Blockchain = Cofree MerkleF Block
    
    Does anyone really think this is how one should write software? I think that constructions like Cofree are interesting, but I don't think they're programming.
  • by macsj200 on 8/20/17, 10:45 PM

    Initially read submission site as malbolge.us
  • by cyphar on 8/20/17, 6:26 PM

    It's quite a cute idea, implementing a blockchain (a fundamentally impure concept) in Haskell. If you're interested in other cool Haskell projects, check out JoeyH[1].

    [1]: http://joeyh.name/code/