Login
You're viewing the mastodon.tn public feed.
  • Oct 25, 2026, 2:31 AM

    …wait a minute. Isn't what I want just foldl with `λ x y = (x << 3) | y`?

    export octal_fold: Bits64 -> Bits64 -> Bits64
    octal_fold a b = (.|.) (shiftL a 3) b

    So I just plug that in and…

    … what?

    (This one went away if I cast [1,2,3,4] to List Bits64 but I can still be annoyed about it. By the way, OCaml likes foldl and Haskell likes foldr, right? Which one does Idris2 prefer?)

    Main> foldl octal_fold 0 [1,2,3,4]
Error: Ambiguous elaboration (on the array 1,2,3,4). Possible results:
    [1, 2, 3, 4]
    [1, 2, 3, 4]
    💬 3🔄 0⭐ 0

Replies