Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Modulo operator doesn't work on ValueMaps  #859

@bgold-cosmos

Description

@bgold-cosmos

As mentioned on https://club.tidalcycles.org/, operators of type |%, |%|, %| are defined but only work in cases like

n $ run 8 |% "2 3.5"

but do not work when used like

(n $ run 8) |% (n "2 3.5")

as (unlike most similar operators) this gives an error

    • No instance for (Real ValueMap) arising from a use of ‘|%’

AFAICT the issue ultimately arises because |%| uses Data.Fixed.mod' which operates on type Real, but ValueMap only has instances for Num, Fractional, and Floating. I don't think it should be too tricky to add a Real instance for ValueMap except that Reals must also be Ord, and I'm not quite sure how <= should be implemented for a ValueMap.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions