Skip to content

Commit

Permalink
resources: UUID-named mutable content
Browse files Browse the repository at this point in the history
  • Loading branch information
jonascarpay authored and considerate committed Dec 20, 2021
1 parent ae02012 commit aa50375
Show file tree
Hide file tree
Showing 7 changed files with 792 additions and 306 deletions.
6 changes: 4 additions & 2 deletions casper.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ extra-source-files: README.md
library
exposed-modules:
Casper
Content
Internal
Casper.Content
Casper.Internal
Casper.Resource

hs-source-dirs: src
default-language: Haskell2010
Expand All @@ -36,6 +37,7 @@ library
, mtl
, process
, stm
, uuid

test-suite casper-spec
type: exitcode-stdio-1.0
Expand Down
9 changes: 7 additions & 2 deletions src/Casper.hs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ module Casper
initStore,
catchError,
hashBS,
newResource,
readResource,
writeResource,
modifyResource,
getRoot,
)
where

import Content
import Casper.Content
import Casper.Internal
import Control.Monad.Except (catchError)
import Internal
6 changes: 3 additions & 3 deletions src/Content.hs → src/Casper/Content.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE TypeOperators #-}

module Content
module Casper.Content
( SHA256 (..),
Ref (..),
Content (..),
Expand Down Expand Up @@ -178,6 +178,8 @@ deriving instance Content Any

deriving instance Content All

type JSONContent a = (Aeson.FromJSON a, Aeson.ToJSON a, Content a)

deriving instance JSONContent a => Content (Product a)

deriving instance JSONContent a => Content (Dual a)
Expand All @@ -188,8 +190,6 @@ deriving instance JSONContent a => Content (First a)

deriving instance JSONContent a => Content (Last a)

type JSONContent a = (Aeson.FromJSON a, Aeson.ToJSON a, Content a)

instance (JSONContent a) => Content [a]

instance JSONContent a => Content (Maybe a)
Expand Down
Loading

0 comments on commit aa50375

Please sign in to comment.