Skip to content

Commit

Permalink
Merge pull request #383 from reflex-frp/jd-use-patch
Browse files Browse the repository at this point in the history
Use patch library instead of Reflex.Patch.*
  • Loading branch information
Ericson2314 authored Jan 10, 2020
2 parents 3b8a112 + 8a98f8d commit 1c522b9
Show file tree
Hide file tree
Showing 23 changed files with 48 additions and 1,172 deletions.
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

* Add `Reflex.Query.Base.mapQueryT`. See that module for documentation

* The `Reflex.Patch.*` modules were moved to the `patch` library.
They are `Data.Patch.*` there, but reexported under their old names for backwards compatability here.

## 0.6.3

* `Data.WeakBag.traverse` and `Data.FastWeakBag.traverse` have been deprecated.
Expand Down
1 change: 1 addition & 0 deletions cabal.project.freeze
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
constraints: any.text < 1.2.4.0
, hlint < 2.2.6 || > 2.2.6
6 changes: 3 additions & 3 deletions dep/reflex-platform/github.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"owner": "reflex-frp",
"repo": "reflex-platform",
"branch": "master",
"rev": "510b990d0b11f0626afbec5fe8575b5b2395391b",
"sha256": "09cmahsbxr0963wq171c7j139iyzz49hramr4v9nsf684wcwkngv"
"branch": "develop",
"rev": "f628398d076243a0851b27e625b37f65dff9b89b",
"sha256": "0sl0hf1glgyb1vmf2mhw4r9ipmcqk1y19d3wsic7dix2jwywzrh9"
}
34 changes: 25 additions & 9 deletions reflex.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Maintainer: [email protected]
Stability: Experimental
Category: FRP
Build-type: Simple
Cabal-version: >=1.9.2
Cabal-version: 1.22
homepage: https://reflex-frp.org
bug-reports: https://github.com/reflex-frp/reflex/issues
extra-source-files:
Expand Down Expand Up @@ -47,6 +47,7 @@ flag split-these
default: True

library
default-language: Haskell2010
hs-source-dirs: src
build-depends:
MemoTrie == 0.6.*,
Expand All @@ -61,6 +62,7 @@ library
lens >= 4.7 && < 5,
monad-control >= 1.0.1 && < 1.1,
mtl >= 2.1 && < 2.3,
patch >= 0.0 && < 0.1,
prim-uniq >= 0.1.0.1 && < 0.2,
primitive >= 0.5 && < 0.8,
profunctors >= 5.3 && < 5.6,
Expand Down Expand Up @@ -88,7 +90,6 @@ library
Data.AppendMap,
Data.FastMutableIntMap,
Data.FastWeakBag,
Data.Functor.Misc,
Data.Map.Misc,
Data.WeakBag,
Reflex,
Expand All @@ -110,13 +111,6 @@ library
Reflex.Host.Class,
Reflex.Network,
Reflex.NotReady.Class,
Reflex.Patch,
Reflex.Patch.Class,
Reflex.Patch.DMap,
Reflex.Patch.DMapWithMove,
Reflex.Patch.IntMap,
Reflex.Patch.Map,
Reflex.Patch.MapWithMove,
Reflex.PerformEvent.Base,
Reflex.PerformEvent.Class,
Reflex.PostBuild.Base,
Expand All @@ -135,6 +129,16 @@ library
Reflex.Widget.Basic,
Reflex.Workflow

reexported-modules:
patch:Data.Functor.Misc,
patch:Data.Patch as Reflex.Patch,
patch:Data.Patch.Class as Reflex.Patch.Class,
patch:Data.Patch.DMap as Reflex.Patch.DMap,
patch:Data.Patch.DMapWithMove as Reflex.Patch.DMapWithMove,
patch:Data.Patch.IntMap as Reflex.Patch.IntMap,
patch:Data.Patch.Map as Reflex.Patch.Map,
patch:Data.Patch.MapWithMove as Reflex.Patch.MapWithMove

ghc-options: -Wall -fwarn-redundant-constraints -fwarn-tabs -funbox-strict-fields -O2 -fspecialise-aggressively

if flag(debug-trace-events)
Expand Down Expand Up @@ -167,6 +171,7 @@ library
build-depends: ghcjs-base

test-suite semantics
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: semantics.hs
hs-source-dirs: test
Expand All @@ -192,6 +197,7 @@ test-suite semantics
Reflex.TestPlan

test-suite CrossImpl
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: Reflex/Test/CrossImpl.hs
hs-source-dirs: test
Expand All @@ -213,6 +219,7 @@ test-suite CrossImpl
Reflex.Plan.Pure

test-suite hlint
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: hlint.hs
hs-source-dirs: test
Expand All @@ -225,6 +232,7 @@ test-suite hlint
buildable: False

test-suite EventWriterT
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: EventWriterT.hs
hs-source-dirs: test
Expand Down Expand Up @@ -252,6 +260,7 @@ test-suite EventWriterT


test-suite RequesterT
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: RequesterT.hs
hs-source-dirs: test
Expand All @@ -276,6 +285,7 @@ test-suite RequesterT
Test.Run

test-suite QueryT
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: QueryT.hs
hs-source-dirs: test
Expand All @@ -287,6 +297,7 @@ test-suite QueryT
, lens
, monoidal-containers
, mtl
, patch
, ref-tf
, reflex
, these
Expand All @@ -302,6 +313,7 @@ test-suite QueryT
Reflex.Plan.Pure

test-suite GC-Semantics
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: GC.hs
hs-source-dirs: test
Expand All @@ -311,6 +323,7 @@ test-suite GC-Semantics
, dependent-map
, deepseq
, mtl
, patch
, these
, transformers
, reflex
Expand All @@ -326,6 +339,7 @@ test-suite GC-Semantics
Test.Run

test-suite rootCleanup
default-language: Haskell2010
type: exitcode-stdio-1.0
main-is: rootCleanup.hs
hs-source-dirs: test
Expand All @@ -343,6 +357,7 @@ test-suite rootCleanup
Test.Run

benchmark spider-bench
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bench test
main-is: Main.hs
Expand All @@ -367,6 +382,7 @@ benchmark spider-bench
Reflex.Bench.Focused

benchmark saulzar-bench
default-language: Haskell2010
type: exitcode-stdio-1.0
hs-source-dirs: bench test
c-sources: bench-cbits/checkCapability.c
Expand Down
2 changes: 1 addition & 1 deletion src/Data/AppendMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ mapMaybeNoNull f as =
then Nothing
else Just bs

-- TODO: Move instances to `Reflex.Patch`
-- TODO: Move instances to `Data.Patch`
-- | Displays a 'MonoidalMap' as a tree. See 'Data.Map.Lazy.showTree' for details.
showTree :: forall k a. (Show k, Show a) => MonoidalMap k a -> String
showTree = coerce (Map.showTree :: Map k a -> String)
Expand Down
6 changes: 3 additions & 3 deletions src/Data/FastMutableIntMap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ import Data.Foldable (traverse_)
import Data.IntMap.Strict (IntMap)
import qualified Data.IntMap.Strict as IntMap
import Data.IORef
import Reflex.Patch.Class
import Reflex.Patch.IntMap
import Data.Patch.Class
import Data.Patch.IntMap

-- | A 'FastMutableIntMap' holds a map of values of type @a@ and allows low-overhead modifications via IO.
-- Operations on 'FastMutableIntMap' run in IO.
Expand Down Expand Up @@ -84,7 +84,7 @@ getFrozenAndClear (FastMutableIntMap r) = do
writeIORef r IntMap.empty
return result

-- | Updates the value of a 'FastMutableIntMap' with the given patch (see 'Reflex.Patch.IntMap'),
-- | Updates the value of a 'FastMutableIntMap' with the given patch (see 'Data.Patch.IntMap'),
-- and returns an 'IntMap' with the modified keys and values.
applyPatch :: FastMutableIntMap a -> PatchIntMap a -> IO (IntMap a)
applyPatch (FastMutableIntMap r) p@(PatchIntMap m) = do
Expand Down
Loading

0 comments on commit 1c522b9

Please sign in to comment.