In the recent thread titled "Vivid: Brief, triggered sounds," Tom suggests some code. I was able to run it, after adding a lot of type signatures. I suspect there's some extension I'm missing that allows GHC to infer those type signatures, because they seem to be flexible (as the comments below indicate).

Is there in fact such an extension I should be using?

  {-# LANGUAGE DataKinds #-}

  import Vivid

  foo = sd (1 :: I "gate") $ do
    e <- adsrGen
      (0.2::Double)  -- Float or Double works
      (0.1::Double)  -- Float or Double works
      (0.6::Double)  -- Float or Double works
      (0.7::Double)  -- Float or Double works
      (Curve_Curve $ -4)
      (gate_ (V::V "gate"))
    s <- e ~* sinOsc (freq_ (500 :: Double)) -- Float or Double works
    out (0::Integer) [s,s]   -- Int or Integer works

  main = do
    s <- synth foo ()
    wait 1
    free s


--
Jeff Brown | Jeffrey Benjamin Brown
Website   |   Facebook   |   LinkedIn(spammy, so I often miss messages here)   |   Github