map function - Dhall

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Matt

hi, I am trying to do a simple map but LSP tells me List/map is unbound:

let Replica = https://raw.githubusercontent.com/ReplicaTest/replica-dhall/main/package.dhall
let Prelude = Replica.Prelude

-- Text/concatSep
let quoteArg : Text -> Text = \(t: Text) -> "'" ++ t ++ "'"
let wrapCmd : List Text -> Text = \(args: List Text) -> "program " ++ Prelude.Text.concatSep " " (List/map quoteArg args)
in {
  wrapCmd
}

How can I refer to List/map via the prelude ?

Matt

what I dont get is the difference between / and . . Is let map = Prelude.List/map wrong ?

Mats Rauhala

let Prelude = Replicate.Prelude doesn't bring the List magically in scope. In fact there is no such concept in dhall. Your map would be Prelude.List.map or you can define let List/map = Prelude.List.map