Skip to content

Commit

Permalink
Fix build of sortableList example
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfmpe committed Feb 21, 2025
1 parent 1e93dcd commit dda0926
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ packages:

tests: True
benchmarks: True

package reflex-dom
flags: +build-examples
2 changes: 1 addition & 1 deletion cabal.project-nogtk
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ package reflex-dom-core
flags: -hlint-tests -hydration-tests -gc-tests

package reflex-dom
flags: +use-warp -webkit2gtk
flags: +use-warp -webkit2gtk +build-examples
9 changes: 3 additions & 6 deletions reflex-dom/examples/sortableList.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
{-# LANGUAGE RecursiveDo #-}
{-# LANGUAGE ScopedTypeVariables #-}
import Control.Lens
import Control.Monad.Identity
import Control.Monad.Fix
import Control.Monad.IO.Class
import Data.Dependent.Map (DMap)
import Data.Functor.Constant
import Data.Functor.Misc
import Data.List
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Monoid
import Data.Ord
import Data.Patch.MapWithMove
import qualified Data.Text as T
import Data.Time.Clock
import Reflex.Dom
Expand Down Expand Up @@ -71,7 +68,7 @@ simpleSortableList :: forall t m k v. (MonadHold t m, MonadFix m, Adjustable t m
simpleSortableList f m0 resortFunc resortSlowFunc = do
rec let resortPatchFast = attachWith (flip patchThatSortsMapWith) (currentIncremental m) resortFunc
redrawPatch :: Map k v -> (v -> v -> Ordering) -> PatchMapWithMove k v
redrawPatch d cmp = unsafePatchMapWithMove $ fmap (MapEdit_Insert False) $ Map.fromList $ zip (Map.keys d) (sortBy cmp $ Map.elems d)
redrawPatch d cmp = patchMapWithMoveInsertAll $ Map.fromList $ zip (Map.keys d) (sortBy cmp $ Map.elems d)
resortPatchSlow = attachWith redrawPatch (currentIncremental m) resortSlowFunc
resortPatch = leftmost
[ resortPatchFast
Expand Down
1 change: 1 addition & 0 deletions reflex-dom/reflex-dom.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ executable sortableList
, dependent-map
, lens
, mtl
, patch
, random
, reflex
, reflex-dom
Expand Down

0 comments on commit dda0926

Please sign in to comment.