Created
August 8, 2022 17:06
-
-
Save JordanMartinez/26968458c1261226b33e574128ba9aae to your computer and use it in GitHub Desktop.
Array.groupBy unexpected behavior
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Prelude | |
import Data.Array as A | |
import Effect (Effect) | |
import Effect.Class.Console (log) | |
import TryPureScript as TryPureScript | |
import Debug (spy) | |
main :: Effect Unit | |
main = TryPureScript.render =<< TryPureScript.withConsole do | |
log $ show $ useGroupBy | |
useGroupBy = [0, 1, 2, 3] | |
# spy "original Array" | |
# A.groupBy (\l r -> do | |
let _ = spy "l" l | |
let _ = spy "r" r | |
l + 1 == r | |
) | |
# spy "post groupBy" | |
-- Check the web console to see the values of `l` and `r` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment