Skip to content

Commit

Permalink
Merge pull request #6 from azardilis/latest-compiler-versions
Browse files Browse the repository at this point in the history
Revert
  • Loading branch information
azardilis authored Jun 14, 2020
2 parents 7e37570 + c2ea3c7 commit 523a033
Show file tree
Hide file tree
Showing 24 changed files with 548 additions and 993 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/cabal.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .gitignore

This file was deleted.

181 changes: 24 additions & 157 deletions chromar.cabal
Original file line number Diff line number Diff line change
@@ -1,166 +1,33 @@
cabal-version: 1.12

-- This file has been generated from package.dhall by hpack version 0.31.0.
--
-- see: https://github.com/sol/hpack
--
-- hash: 462ba9eb4531d9fe5b7fbcac0a62eddf10bbdad1a4cdb31bd77764cf90085bd5

name: chromar
version: 0.1.0.0
synopsis: none
homepage: none
author: none
maintainer: none
build-type: Simple
cabal-version: >=1.8

library
build-depends:
base,
containers,
haskell-src-meta,
multiset,
parsec,
random,
template-haskell
if impl(ghc >= 8.10.0)
other-modules:
Internal.RuleQuotes
hs-source-dirs:
src-ghc-8.10
if impl(ghc >= 8.8.0) && impl(ghc < 8.10.0)
other-modules:
Internal.RuleQuotes
hs-source-dirs:
src-ghc-8.8
if impl(ghc >= 8.6.0) && impl(ghc < 8.8.0)
other-modules:
Internal.RuleQuotes
hs-source-dirs:
src-ghc-8.6
hs-source-dirs:
src
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
exposed-modules:
Chromar.Core
Chromar.RuleQuotesE
Chromar.Multiset
Chromar.MAttrs
Chromar.MRuleParser
Chromar.RExprs
Chromar.Experiment
Chromar
other-modules:
Paths_chromar
default-language: Haskell2010

test-suite gdiff
type: exitcode-stdio-1.0
main-is: gdiff.hs
hs-source-dirs:
models
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers
buildable: False
default-language: Haskell2010

test-suite germ
type: exitcode-stdio-1.0
main-is: germ.hs
other-modules:
SeedsModel.Env
SeedsModel.Germ
hs-source-dirs:
models/seedsModel
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers,
normaldistribution,
random,
text
buildable: False
default-language: Haskell2010

test-suite market
type: exitcode-stdio-1.0
main-is: Market.hs
hs-source-dirs:
models/market
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers,
normaldistribution,
random
buildable: False
default-language: Haskell2010

test-suite model
type: exitcode-stdio-1.0
main-is: model.hs
hs-source-dirs:
models
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers
buildable: False
default-language: Haskell2010

test-suite plant
type: exitcode-stdio-1.0
main-is: plant.hs
hs-source-dirs:
models
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers
default-language: Haskell2010

test-suite simple
type: exitcode-stdio-1.0
main-is: simple.hs
hs-source-dirs:
models
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers
default-language: Haskell2010

test-suite utils
type: exitcode-stdio-1.0
main-is: utils.hs
other-modules:
SeedsModel.Env
SeedsModel.Utils
hs-source-dirs:
models
other-extensions: BangPatterns
ghc-options: -Wall -Werror -Wincomplete-uni-patterns -Wcompat -Widentities -Wredundant-constraints -fhide-source-paths
build-depends:
base,
chromar,
containers,
normaldistribution,
random,
text
buildable: False
default-language: Haskell2010
build-depends: base,
random >=1.1 && <1.2,
parsec >=3.1 && <3.2,
template-haskell >=2.10 && <2.12,
haskell-src-meta >= 0.6,
containers >=0.5,
multiset >= 0.3
ghc-options: -O2

hs-source-dirs: src

exposed-modules: Chromar.Core
Chromar.RuleQuotesE
Chromar.Multiset
Chromar.MAttrs
Chromar.MRuleParser
Chromar.RExprs
Chromar.Experiment
Chromar

other-extensions: BangPatterns

default-language: Haskell2010
6 changes: 3 additions & 3 deletions models/plant.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ isB _ = False
$(return [])

--- Rules
growth = [rule| L{m=m}, B{c=c} --> L{m='m+1.0'}, B{c='c-1.0'} @'c/m' ['c-1>0'] |]
assimilation = [rule| L{m=m}, B{c=c} --> L{m='m'}, B{c='c+1'} @'m' ['True'] |]
leafCreation = [rule| R{n=n} --> R{n='n+1'}, L{m='0'} @'0.0001' ['True'] |]
growth = [rule| L{m=m}, B{c=c} --> L{m=m+1.0}, B{c=c-1.0} @c/m [c-1>0] |]
assimilation = [rule| L{m=m}, B{c=c} --> L{m=m}, B{c=c+1} @m [True] |]
leafCreation = [rule| R{n=n} --> R{n=n+1}, L{m=0} @0.0001 [True] |]


--- Initial state
Expand Down
24 changes: 12 additions & 12 deletions models/simple.hs
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

import Chromar
import Chromar

-- Agent declarations
data Agent = A { x :: Int } deriving (Eq, Show)
data Agent = A { x :: Int }
deriving (Eq, Show)

$(return [])

-- Rules
r1, r2 :: [(Agent, Int)] -> Time -> [Rxn Agent]
r1 = [rule| A{x=x}, A{x=y} --> A{x='x+1'}, A{x='y-1'} @'1.0' ['y > 0'] |]
r2 = [rule| A{x=x} --> A{x='x'}, A{x='0'} @'1.0' |]

na, nx :: Er Agent Int
na = [er| select A{x=x}; aggregate (count . 'count + 1') '0' |]
nx = [er| select A{x=x}; aggregate (count . 'count + x') '0' |]

s :: Multiset Agent
s = ms [A{x=5}, A{x=5}]

model :: Model Agent
model = Model{ rules = [r1, r2], initState = s }
model =
Model
{ rules = [r1, r2]
, initState = s
}

main :: IO ()
main = let nsteps = 100 in run model nsteps (zipEr2 na nx)
main =
let nsteps = 100
in run model nsteps (zipEr2 na nx)
1 change: 0 additions & 1 deletion out/README.md

This file was deleted.

Loading

0 comments on commit 523a033

Please sign in to comment.