lamdera / lamdera/compiler

Bytes flag causes Map.! error

Open
#26 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
95
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Quick Summary:
Running lamdera make Generate.elm on the following code will trigger a

lamdera: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
  error, called at libraries/containers/containers/src/Data/Map/Internal.hs:633:17 in containers-0.6.5.1:Data.Map.Internal

error.

The error goes away if I switch the flags from Bytes to String. I would expect bytes to be supported in Lamdera since you can pass bytes through ports in Lamdera.

SSCCE

module Generate exposing (main)

{-| -}

import Bytes exposing (Bytes)


main : Program Bytes () ()
main =
    Platform.worker
        { init =
            \flags ->
                ( ()
                , Cmd.none
                )
        , update =
            \_ model ->
                ( model, Cmd.none )
        , subscriptions = \_ -> Sub.none
        }

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run lamdera make Generate.elm with the supplied SSCCE, then compare it with the String-flags version. Investigate why the Bytes flags path reaches the reported Map.! failure; done means the Bytes example completes without that error and remains supported.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm, haskell
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.