Commit 236e1956 authored by Marc Coiffier's avatar Marc Coiffier
Browse files

Increment the version of definitive-parser, due to the massive change that...

Increment the version of definitive-parser, due to the massive change that occurred; correct the build for curly-gateway
parent 681c9487
......@@ -2,7 +2,7 @@
-- see http://haskell.org/cabal/users-guide/
name: capricon
version: 0.7.1
version: 0.7.1.1
-- synopsis:
-- description:
license: GPL-3
......@@ -20,7 +20,7 @@ data-files: prelude
library
exposed-modules: Algebra.Monad.Concatenative Data.CaPriCon CaPriCon.Run
default-extensions: RebindableSyntax, ViewPatterns, TupleSections, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, FunctionalDependencies, LambdaCase, TypeOperators, RankNTypes, GeneralizedNewtypeDeriving, TypeFamilies
build-depends: base,definitive-base, definitive-parser
build-depends: base >=4.8 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1
if !impl(haste)
ghc-options: -Wincomplete-patterns -Wname-shadowing -W -Werror
hs-source-dirs: src
......@@ -30,12 +30,12 @@ executable capricon
if impl(haste)
buildable: False
else
build-depends: hreadline, directory, filepath
build-depends: directory >=1.3 && <1.4,filepath >=1.4 && <1.5,hreadline >=0.2 && <0.3
main-is: CaPriCon.hs
default-extensions: RebindableSyntax, ViewPatterns, TupleSections, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, FunctionalDependencies, LambdaCase, TypeOperators, RankNTypes, GeneralizedNewtypeDeriving, TypeFamilies
-- other-modules:
-- other-extensions:
build-depends: base,definitive-base, definitive-parser, capricon
build-depends: base >=4.8 && <4.10,capricon >=0.7 && <0.8,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1
ghc-options: -Wincomplete-patterns -Wname-shadowing -W -Werror
hs-source-dirs: exe
default-language: Haskell2010
......@@ -47,7 +47,7 @@ executable WiQEE.js
-- other-modules:
-- other-extensions:
haste-options: --opt-all
build-depends: base,definitive-base, definitive-parser, capricon, haste-lib, filepath
build-depends: base >=4.8 && <4.10,capricon >=0.7 && <0.8,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1,filepath >=1.4 && <1.5,haste-lib
hs-source-dirs: exe
default-language: Haskell2010
-- executable coinche
......@@ -55,7 +55,7 @@ executable WiQEE.js
-- default-extensions: RebindableSyntax
-- -- other-modules:
-- -- other-extensions:
-- build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7, definitive-parser, misc, random, random-shuffle
-- build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1,misc >=. && <.1,random >=1.1 && <1.2,random-shuffle >=. && <.1
-- ghc-options: -Wincomplete-patterns -Wname-shadowing -Werror
-- hs-source-dirs: exe
-- default-language: Haskell2010
......@@ -46,7 +46,7 @@ instance MonadSubIO JS.CIO JS.CIO where liftSubIO = id
runComment c = unit
hasteDict :: COCDict JS.CIO String
hasteDict = cocDict ("0.7.1-js" :: String) get (\_ _ -> return ())
hasteDict = cocDict ("0.7.1.1-js" :: String) get (\_ _ -> return ())
where get file = do
mres <- liftIO $ JS.getItem (fromString file)
case mres of
......
......@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: curly-core
version: 0.7.1
version: 0.7.2
synopsis: The core libraries for the Curly compiler.
-- description:
license: GPL-3
......@@ -48,7 +48,7 @@ library
AllowAmbiguousTypes
LambdaCase
other-extensions: UndecidableInstances, ScopedTypeVariables, StandaloneDeriving, PatternSynonyms, ViewPatterns, TypeFamilies, CPP, RecursiveDo, GADTs, DeriveGeneric, OverloadedStrings, NoMonomorphismRestriction, DeriveDataTypeable, ExistentialQuantification, BangPatterns
build-depends: AES >=0.2 && <0.3,base >=4.9 && <4.10,base64-bytestring >=1.0 && <1.1,bytestring >=0.10 && <0.11,containers >=0.5 && <0.6,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-network >=1.4 && <1.5,definitive-parser >=2.5 && <2.6,directory >=1.3 && <1.4,entropy >=0.3 && <0.4,fsnotify,network >=2.6 && <2.7,process >=1.4 && <1.5,zlib >=0.6 && <0.7
build-depends: AES >=0.2 && <0.3,base >=4.9 && <4.10,base64-bytestring >=1.0 && <1.1,bytestring >=0.10 && <0.11,containers >=0.5 && <0.6,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-network >=1.4 && <1.5,definitive-parser >=3.0 && <3.1,directory >=1.3 && <1.4,entropy >=0.3 && <0.4,fsnotify >=0.2 && <0.3,network >=2.6 && <2.7,process >=1.4 && <1.5,zlib >=0.6 && <0.7
if flag(paranoid)
ghc-options: -Wall -Werror
hs-source-dirs: src
......
......@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: curly-gateway
version: 0.1.1
version: 0.2
synopsis: A DHT-backed implementation of the Curly VCS protocol
-- description:
license: GPL-3
......@@ -29,6 +29,6 @@ executable curly-gateway
GeneralizedNewtypeDeriving
RankNTypes
other-extensions: DeriveGeneric, TypeFamilies, ScopedTypeVariables, PatternSynonyms, ViewPatterns
build-depends: base >=4.9 && <4.10,curly-core >=0.7 && <0.8,curly-kademlia >=1.1 && <1.2,definitive-base >=2.6 && <2.7,definitive-network >=1.4 && <1.5,definitive-parser >=2.5 && <2.6
build-depends: base >=4.9 && <4.10,curly-core >=0.7 && <0.8,curly-kademlia >=1.1 && <1.2,definitive-base >=2.6 && <2.7,definitive-network >=1.4 && <1.5,definitive-parser >=3.0 && <3.1
hs-source-dirs: src
default-language: Haskell2010
{-# LANGUAGE DeriveGeneric, TypeFamilies, ScopedTypeVariables, PatternSynonyms #-}
{-# LANGUAGE DeriveGeneric, TypeFamilies, ScopedTypeVariables, PatternSynonyms, UndecidableInstances #-}
module Curly.DHT.Kademlia (
DHTIndex,DHTValue,
DHTInstance,DHTNode,pattern DHTNode,
......@@ -12,18 +12,18 @@ import Network.Kademlia (JoinResult(..))
newtype K a = K { getK :: a }
deriving (Eq,Ord)
instance K.Serialize a => Serializable (K a) where
encode (K a) = encode (K.toBS a^..chunk)
instance K.Serialize a => Format (K a) where
instance K.Serialize a => Serializable Word8 Builder Bytes (K a) where
encode p (K a) = encode p (K.toBS a^..chunk)
instance K.Serialize a => Format Word8 Builder Bytes (K a) where
datum = datum >>= (const zero <|> return) . map (K . fst) . K.fromBS . by chunk
instance Format a => K.Serialize (K a) where
instance Format Word8 Builder Bytes a => K.Serialize (K a) where
fromBS b = case (datum^..parser) (b^..chunk) of
(s,a):_ -> Right (K a,s^.chunk)
[] -> Left "Parse error"
toBS (K a) = serialize a^.chunk
class (Ord a,Format a) => DHTIndex a
class (Eq a,Format a) => DHTValue a
class (Ord a,Format Word8 Builder Bytes a) => DHTIndex a
class (Eq a,Format Word8 Builder Bytes a) => DHTValue a
newtype DHTInstance i a = DHTInstance { _getDHTInstance :: K.KademliaInstance (K i) (K a) }
newtype DHTNode i = DHTNodeImpl { _getDHTNode :: K.Node (K i) }
pattern DHTNode h p i = DHTNodeImpl (K.Node (K.Peer h p) (K i))
......
......@@ -25,19 +25,19 @@ instance DHTIndex (VCKey DHTKey)
data DHTKey = DataKey ValID
| NodeKey String
deriving (Eq,Ord,Generic)
instance Serializable DHTKey ; instance Format DHTKey
instance Serializable Word8 Builder Bytes DHTKey ; instance Format Word8 Builder Bytes DHTKey
type Key = VCKey DHTKey
newtype ValID = ValID Hash
deriving (Eq,Ord,Show,Generic)
instance Serializable ValID; instance Format ValID
instance Serializable Word8 Builder Bytes ValID; instance Format Word8 Builder Bytes ValID
data Val = PartialVal [ValID]
| DataVal Bytes
deriving (Show,Generic)
instance Serializable Val ; instance Format Val
instance Serializable Word8 Builder Bytes Val ; instance Format Word8 Builder Bytes Val
instance Eq Val where a==b = compare a b==EQ
instance Ord Val where compare = comparing serialize
instance Ord Val where compare = comparing (serialize :: Val -> Bytes)
instance DHTValue Val
newtype DHT_VC a = DHT_VC { runDHT_VC :: IO a }
......@@ -75,10 +75,10 @@ lookupMPBytes dht k = do
return (fold <$> sequence parts)
Nothing -> return Nothing
lookupMP :: (Format a,MonadIO m) => DHTInstance Key Val -> (WithResponse a -> Key) -> m (Maybe a)
lookupMP dht fk = liftIO $ lookupMPBytes dht (fk WithResponse) <&> (>>= matches Just datum)
insertMP :: (Serializable a,MonadIO m) => DHTInstance Key Val -> (WithResponse a -> Key) -> a -> m ()
insertMP dht fk a = liftIO $ insertMPBytes dht (serialize a) >>= \cid -> insertDHT dht (fk WithResponse) (PartialVal [cid])
lookupMP :: (Format Word8 Builder Bytes a,MonadIO m) => DHTInstance Key Val -> (Proxy a -> Key) -> m (Maybe a)
lookupMP dht fk = liftIO $ lookupMPBytes dht (fk Proxy) <&> (>>= matches Just datum)
insertMP :: (Serializable Word8 Builder Bytes a,MonadIO m) => DHTInstance Key Val -> (Proxy a -> Key) -> a -> m ()
insertMP dht fk a = liftIO $ insertMPBytes dht (serialize a) >>= \cid -> insertDHT dht (fk Proxy) (PartialVal [cid])
isValidAssoc (OtherKey (DataKey h)) v = valID v == h
isValidAssoc _ _ = True
......@@ -135,11 +135,11 @@ data HTTPMessage = HTTPMessage {
messageBody :: Bytes
}
deriving Show
instance Serializable HTTPMessageType where
encode (GET uri) = foldMap encode ("GET " + uri + " HTTP/1.1\r\n")
encode (PUT uri) = foldMap encode ("PUT " + uri + " HTTP/1.1\r\n")
encode Response = foldMap encode ("HTTP/1.1 200 OK\r\n")
instance Format HTTPMessageType where
instance Serializable Word8 Builder Bytes HTTPMessageType where
encode p (GET uri) = foldMap (encode p) ("GET " + uri + " HTTP/1.1\r\n")
encode p (PUT uri) = foldMap (encode p) ("PUT " + uri + " HTTP/1.1\r\n")
encode p Response = foldMap (encode p) ("HTTP/1.1 200 OK\r\n")
instance Format Word8 Builder Bytes HTTPMessageType where
datum = req <+? resp
where req = do
t <- (GET <$ kw "GET") <+? (PUT <$ kw "PUT")
......@@ -149,13 +149,13 @@ instance Format HTTPMessageType where
return (t uri)
resp = kw "HTTP/1.1" >> skipMany' (charOut "\r\n") >> kw "\r\n" >> return Response
instance Serializable HTTPMessage where
encode (HTTPMessage t hdrs body) =
encode t
+ foldMap (\(n,v) -> foldMap encode (n+": "+v+"\r\n")) (hdrs^.ascList)
+ foldMap encode "\r\n"
instance Serializable Word8 Builder Bytes HTTPMessage where
encode p (HTTPMessage t hdrs body) =
encode p t
+ foldMap (\(n,v) -> foldMap (encode p) (n+": "+v+"\r\n")) (hdrs^.ascList)
+ foldMap (encode p) "\r\n"
+ body^.bytesBuilder
instance Format HTTPMessage where
instance Format Word8 Builder Bytes HTTPMessage where
datum = do
t <- datum
hdrs <- map fromAList $ many' $ do
......@@ -194,7 +194,7 @@ main = do
let msgKeyName = select (/='/') msgURI
msgKey :: Maybe (VCKey ())
msgKey = matches Just ((readable <&> \(B64Chunk b) -> b^..chunk) >*> datum) msgKeyName
getKey, putKey :: Format a => (WithResponse a -> VCKey ()) -> ParserT Bytes IO ()
getKey, putKey :: Format Word8 Builder Bytes a => (Proxy a -> VCKey ()) -> ParserT Bytes IO ()
getKey k = vcbLoad backend k >>= \res -> do
case res of
Just body -> send (HTTPMessage Response (fromAList [("connection","close")]) (serialize body))
......
......@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: curly-system
version: 0.3.2
version: 0.3.3
synopsis: System-specific code generation libraries for the Curly compiler
-- description:
license: GPL-3
......@@ -33,7 +33,7 @@ library
GeneralizedNewtypeDeriving
RankNTypes
other-extensions: UndecidableInstances, RecursiveDo, ScopedTypeVariables, NoMonomorphismRestriction, PatternSynonyms, CPP, TypeFamilies, StandaloneDeriving
build-depends: base >=4.9 && <4.10,curly-core >=0.7 && <0.8,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-parser >=2.5 && <2.6
build-depends: base >=4.9 && <4.10,curly-core >=0.7 && <0.8,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-parser >=3.0 && <3.1
hs-source-dirs: src
if flag(paranoid)
ghc-options: -Werror
......
......@@ -2,7 +2,7 @@
-- see http://haskell.org/cabal/users-guide/
name: curly
version: 0.59.4.1
version: 0.59.4.2
synopsis: A minimal cross-compiler for the simply-typed lambda-calculus
-- description:
license: GPL-3
......@@ -57,7 +57,7 @@ library
TypeFamilies
LambdaCase
other-extensions: CPP, ExistentialQuantification, ViewPatterns, TypeFamilies, ScopedTypeVariables, RecursiveDo, DeriveGeneric, NoMonomorphismRestriction, QuasiQuotes, TemplateHaskell
build-depends: base >=4.9 && <4.10,curly-core >=0.7 && <0.8,curly-system >=0.3 && <0.4,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-network >=1.4 && <1.5,definitive-parser >=2.5 && <2.6,directory >=1.3 && <1.4,filepath >=1.4 && <1.5,process >=1.4 && <1.5,terminal-size >=0.3 && <0.4,unix >=2.7 && <2.8, hreadline, template-haskell
build-depends: base >=4.9 && <4.10,curly-core >=0.7 && <0.8,curly-system >=0.3 && <0.4,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-network >=1.4 && <1.5,definitive-parser >=3.0 && <3.1,directory >=1.3 && <1.4,filepath >=1.4 && <1.5,hreadline >=0.2 && <0.3,process >=1.4 && <1.5,template-haskell >=2.11 && <2.12,terminal-size >=0.3 && <0.4,unix >=2.7 && <2.8
hs-source-dirs: src
executable curly
......@@ -77,5 +77,5 @@ executable curly
GeneralizedNewtypeDeriving
RankNTypes
TypeFamilies
build-depends: base >=4.9 && <4.10,curly >=0.59 && <0.60,curly-core >=0.7 && <0.8,curly-system >=0.3 && <0.4,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-network >=1.4 && <1.5,definitive-parser >=2.5 && <2.6,directory >=1.3 && <1.4,filepath >=1.4 && <1.5,process >=1.4 && <1.5,unix >=2.7 && <2.8, hreadline
build-depends: base >=4.9 && <4.10,curly >=0.59 && <0.60,curly-core >=0.7 && <0.8,curly-system >=0.3 && <0.4,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-filesystem >=2.1 && <2.2,definitive-network >=1.4 && <1.5,definitive-parser >=3.0 && <3.1,directory >=1.3 && <1.4,filepath >=1.4 && <1.5,hreadline >=0.2 && <0.3,process >=1.4 && <1.5,unix >=2.7 && <2.8
......@@ -31,6 +31,6 @@ library
MultiParamTypeClasses
Rank2Types
-- other-extensions:
build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=2.5 && <2.6,network >=2.6 && <2.7
build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1,network >=2.6 && <2.7
hs-source-dirs: src
default-language: Haskell2010
......@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/
name: definitive-parser
version: 2.5.1
version: 3.0
synopsis: General LogicT-based parser combinator library compatible with the definitive-base Prelude
-- description:
license: GPL-3
......@@ -31,6 +31,6 @@ library
MultiParamTypeClasses
Rank2Types
other-extensions: UndecidableInstances, TypeFamilies, ScopedTypeVariables, ExistentialQuantification, ImplicitParams, DefaultSignatures
build-depends: base,bytestring,deepseq,definitive-base,utf8-string
build-depends: base >=4.8 && <4.10,bytestring >=0.10 && <0.11,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,utf8-string >=1.0 && <1.1
hs-source-dirs: src
default-language: Haskell2010
......@@ -24,4 +24,4 @@ executable grow
main-is: Grow.hs
hs-source-dirs: exe
default-extensions: RebindableSyntax, TypeOperators, GeneralizedNewtypeDeriving, TupleSections, FlexibleContexts, DefaultSignatures
build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=2.5 && <2.6,directory >=1.3 && <1.4,time >=1.6 && <1.7,unix >=2.7 && <2.8
build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1,directory >=1.3 && <1.4,time >=1.6 && <1.7,unix >=2.7 && <2.8
......@@ -30,5 +30,5 @@ library
RankNTypes
TypeFamilies
LambdaCase
build-depends: base >=4.9 && <4.10,deepseq,definitive-base,definitive-parser,terminal-size,template-haskell
build-depends: base >=4.9 && <4.10,deepseq >=1.4 && <1.5,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1,template-haskell >=2.11 && <2.12,terminal-size >=0.3 && <0.4
hs-source-dirs: src
......@@ -39,10 +39,11 @@ packages: []
# Dependency packages to be pulled from upstream that are not in the resolver
# (e.g., acme-missiles-0.3)
extra-deps:
- AES-0.2.9
- kademlia-1.1.0.0
- ./curly
- ./capricon
- ./curly-gateway
- AES-0.2.9
- kademlia-1.1.0.0
- ./definitive-base
- ./definitive-parser
- ./definitive-network
......@@ -51,7 +52,6 @@ extra-deps:
- ./curly-kademlia
- ./curly-core
- ./curly-system
- ./curly-gateway
# Override default flag values for local packages and extra-deps
# flags: {}
......
......@@ -28,6 +28,6 @@ executable woosh
AllowAmbiguousTypes,
RoleAnnotations
other-extensions: ImplicitParams, StandaloneDeriving, MultiParamTypeClasses, RankNTypes, DefaultSignatures, TupleSections, Rank2Types, FunctionalDependencies, ViewPatterns, LiberalTypeSynonyms, NoRebindableSyntax, EmptyDataDecls, CPP, ScopedTypeVariables, UndecidableInstances, DeriveGeneric, ExistentialQuantification, RecursiveDo, DeriveDataTypeable
build-depends: base >=4.9 && <4.10,definitive-base,definitive-parser, utf8-string
build-depends: base >=4.9 && <4.10,definitive-base >=2.6 && <2.7,definitive-parser >=3.0 && <3.1,utf8-string >=1.0 && <1.1
hs-source-dirs: exe
default-language: Haskell2010
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment