We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f02db51 commit 94fe276Copy full SHA for 94fe276
2 files changed
lapse.cabal
@@ -1,6 +1,6 @@
1
cabal-version: 3.0
2
name: lapse
3
-version: 2.0.4
+version: 2.0.5
4
license: GPL-3.0-only
5
license-file: LICENSE
6
author: ProggerX
src/Lapse/Lambda.hs
@@ -4,7 +4,7 @@ module Lapse.Lambda where
import Control.Monad ((<=<))
import Control.Monad.State (get, gets, put)
7
-import Data.List (sort)
+import Data.List (group, sort)
8
import Data.Map.Strict (empty, fromList)
9
import Lapse.Eval (eval)
10
import Lapse.Operators (lset)
@@ -93,6 +93,6 @@ findFree = \case
93
94
compact :: Func
95
compact v = do
96
- freeVars <- sort <$> findFree v
+ freeVars <- (map head . group) . sort <$> findFree v
97
let args = foldr (Pair . Name) Nil freeVars
98
Function <$> mkFunction args v
0 commit comments