You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GHCi, version 9.10.1: https://www.haskell.org/ghc/ :? for help
ghci> import Sound.Tidal.Context
ghci> :set -XOverloadedStrings
ghci> :t spread' slow "2 4%3" $ sound "ho ho:2 ho:3 hc"
<interactive>:1:14: error: [GHC-39999]
• No instance for ‘Enumerable (Pattern Time)’
arising from the literal ‘"2 4%3"’
• In the second argument of ‘spread'’, namely ‘"2 4%3"’
In the first argument of ‘($)’, namely ‘spread' slow "2 4%3"’
In the expression: spread' slow "2 4%3" $ sound "ho ho:2 ho:3 hc"
NB: to catch documentation bugs like this, it would be good to have a method of evaluating examples (like https://github.com/sol/doctest#readme) (at least, type-checking)
The text was updated successfully, but these errors were encountered:
It looks like the docs are out of date there. spread' is meant to be used with functions that don't take "patternified" arguments. So
spread' _slow "2 4%3" $ sound "ho ho ho hc"
evaluates correctly. But a lot of Tidal functions were updated so that their "vanilla" version already accepts pattern arguments, which makes spread' mostly redundant in those cases.
Yes when spread' was written, the signature of slow would be
slow::Time->Patterna->Patterna
now of course it's
slow::PatternTime->Patterna->Patterna
and patterns of numbers are numbers so slow 2 still works. The unpatternified function _slow exists but only for internal use to try to be a bit more efficient in cases where the value is never a pattern.
As you say spread' is now redundant. I think we should probably just remove it.
https://hackage.haskell.org/package/tidal-1.9.5/docs/Sound-Tidal-UI.html#v:spread-39-
this version is type-correct (inserting
pure
)is that how it's supposed to be used? (I guess not, since implementation then does
pure "..." >>= _
where the monadic-bind is useless)then perhaps this?
NB: to catch documentation bugs like this, it would be good to have a method of evaluating examples (like https://github.com/sol/doctest#readme) (at least, type-checking)
The text was updated successfully, but these errors were encountered: