Difference between revisions of "All the functions"

From TidalCycles userbase
Jump to: navigation, search
 
Line 1: Line 1:
 
Here are all the functions provided by the main Tidal library modules.
 
Here are all the functions provided by the main Tidal library modules.
  
Many will be only for internal use, but there are some useful things here yet to be documented.
+
This is mainly intended as a guide for people helping document tidalcycles. Many of the following functions will be only for internal use and not of interest to end-user musicians, but there are some useful things here yet to be documented.
  
 
= Sound.Tidal.Core =
 
= Sound.Tidal.Core =

Latest revision as of 11:48, 10 December 2018

Here are all the functions provided by the main Tidal library modules.

This is mainly intended as a guide for people helping document tidalcycles. Many of the following functions will be only for internal use and not of interest to end-user musicians, but there are some useful things here yet to be documented.

Sound.Tidal.Core

Function Type Marked
# Sound.Tidal.Context.Unionable b => Pattern b -> Pattern b -> Pattern b
%| Real a => Pattern a -> Pattern a -> Pattern a
*| Num a => Pattern a -> Pattern a -> Pattern a
+| Num a => Pattern a -> Pattern a -> Pattern a
-| Num a => Pattern a -> Pattern a -> Pattern a
/| Fractional a => Pattern a -> Pattern a -> Pattern a
<> Pattern a -> Pattern a -> Pattern a
<| Sound.Tidal.Context.Unionable a => Pattern a -> Pattern a -> Pattern a
<~ Pattern Time -> Pattern a -> Pattern a
>| Sound.Tidal.Context.Unionable a => Pattern a -> Pattern a -> Pattern a
_every Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_every' Int -> Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_fast Time -> Pattern a -> Pattern a
_run (Enum a, Num a) => a -> Pattern a
_scan (Enum a, Num a) => a -> Pattern a
_slow Time -> Pattern a -> Pattern a
append Pattern a -> Pattern a -> Pattern a
cat [Pattern a] -> Pattern a
compress Arc -> Pattern a -> Pattern a TODO
compressTo Arc -> Pattern a -> Pattern a TODO
cosine Fractional a => Pattern a TODO
density Pattern Time -> Pattern a -> Pattern a
densityGap Pattern Time -> Pattern a -> Pattern a
envEq Pattern Double TODO
envEqR Pattern Double TODO
envL Pattern Double TODO
envLR Pattern Double TODO
every Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
every' Pattern Int -> Pattern Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
fast Pattern Time -> Pattern a -> Pattern a
fastAppend Pattern a -> Pattern a -> Pattern a
fastCat [Pattern a] -> Pattern a
fastFromList [a] -> Pattern a TODO
fastGap Pattern Time -> Pattern a -> Pattern a TODO
fastRepeatCycles Int -> Pattern a -> Pattern a
fastSqueeze Pattern Time -> Pattern a -> Pattern a
fastcat [Pattern a] -> Pattern a
foldEvery [Int] -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
fromList [a] -> Pattern a TODO
fromMaybes [Maybe a] -> Pattern a
isaw (Fractional a, Real a) => Pattern a TODO
listToPat [a] -> Pattern a
overlay Pattern a -> Pattern a -> Pattern a
repeatCycles Int -> Pattern a -> Pattern a
rev Pattern a -> Pattern a
run (Enum a, Num a) => Pattern a -> Pattern a
saw (Fractional a, Real a) => Pattern a TODO
scan (Enum a, Num a) => Pattern a -> Pattern a
sig (Time -> a) -> Pattern a TODO
silence Pattern a TODO
sine Fractional a => Pattern a TODO
slow Pattern Time -> Pattern a -> Pattern a
slowAppend Pattern a -> Pattern a -> Pattern a
slowCat [Pattern a] -> Pattern a
slowSqueeze Pattern Time -> Pattern a -> Pattern a TODO
slowcat [Pattern a] -> Pattern a
sparsity Pattern Time -> Pattern a -> Pattern a
square (Fractional a, Real a) => Pattern a TODO
stack [Pattern a] -> Pattern a
timeCat [(Time, Pattern a)] -> Pattern a TODO
tri (Fractional a, Real a) => Pattern a TODO
when (Int -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
whenT (Time -> Bool) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a TODO
zoom Arc -> Pattern a -> Pattern a
|% Real a => Pattern a -> Pattern a -> Pattern a
|%| (Applicative a, Real b) => a b -> a b -> a b
|* Num a => Pattern a -> Pattern a -> Pattern a
|*| (Applicative a, Num b) => a b -> a b -> a b
|+ Num a => Pattern a -> Pattern a -> Pattern a
|+| (Applicative a, Num b) => a b -> a b -> a b
|- Num a => Pattern a -> Pattern a -> Pattern a
|-| (Applicative a, Num b) => a b -> a b -> a b
|/ Fractional a => Pattern a -> Pattern a -> Pattern a
|/| (Applicative a, Fractional b) => a b -> a b -> a b
|< Sound.Tidal.Context.Unionable a => Pattern a -> Pattern a -> Pattern a
|<| (Applicative a, Sound.Tidal.Context.Unionable b) => a b -> a b -> a b
|> Sound.Tidal.Context.Unionable a => Pattern a -> Pattern a -> Pattern a
|>| (Applicative a, Sound.Tidal.Context.Unionable b) => a b -> a b -> a b
~> Pattern Time -> Pattern a -> Pattern a

Sound.Tidal.Control

Function Type Marked
_cF [Double] -> String -> Pattern Double
_cP (Enumerable a, Parseable a) => [Pattern a] -> String -> Pattern a
_cS [String] -> String -> Pattern String
_cX (Arc -> Value -> [Event a]) -> [a] -> String -> Pattern a
_chop Int -> ControlPattern -> ControlPattern
_gap Int -> ControlPattern -> ControlPattern
_slice Int -> Int -> ControlPattern -> ControlPattern
_spin Int -> ControlPattern -> ControlPattern
_striate Int -> ControlPattern -> ControlPattern
_striateBy Int -> Double -> ControlPattern -> ControlPattern
_stut Integer -> Double -> Rational -> ControlPattern -> ControlPattern
_stutWith (Num n, Ord n) => n -> Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
cF Double -> String -> Pattern Double
cF0 String -> Pattern Double
cF_ String -> Pattern Double TODO
cI String -> Pattern Int TODO
cP (Enumerable a, Parseable a) => Pattern a -> String -> Pattern a TODO
cP_ (Enumerable a, Parseable a) => String -> Pattern a TODO
cR Time -> String -> Pattern Rational TODO
cR0 String -> Pattern Time TODO
cR_ String -> Pattern Time TODO
cS String -> String -> Pattern String TODO
cS_ String -> Pattern String TODO
cT Time -> String -> Pattern Time TODO
cT0 String -> Pattern Time TODO
cT_ String -> Pattern Time TODO
chop Pattern Int -> ControlPattern -> ControlPattern
chopArc Arc -> Int -> [Arc]
gap Pattern Int -> ControlPattern -> ControlPattern
hurry Pattern Rational -> ControlPattern -> ControlPattern
in0 Pattern Double
in1 Pattern Double TODO
... up to ...
in127 Pattern Double TODO
interlace ControlPattern -> ControlPattern -> ControlPattern
loopAt Pattern Time -> ControlPattern -> ControlPattern
mergePlayRange (Double, Double) -> ControlMap -> ControlMap
randslice Int -> ControlPattern -> ControlPattern TODO
slice Pattern Int -> Pattern Int -> ControlPattern -> ControlPattern TODO
smash Pattern Int -> [Pattern Time] -> ControlPattern -> Pattern ControlMap
smash' Int -> [Pattern Time] -> ControlPattern -> Pattern ControlMap
spin Pattern Int -> ControlPattern -> ControlPattern
striate Pattern Int -> ControlPattern -> ControlPattern
striate' Pattern Int -> Pattern Double -> ControlPattern -> ControlPattern
striateBy Pattern Int -> Pattern Double -> ControlPattern -> ControlPattern
stut Pattern Integer -> Pattern Double -> Pattern Rational -> ControlPattern -> ControlPattern
stut' Pattern Int -> Pattern Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
stutWith Pattern Int -> Pattern Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
weave Time -> ControlPattern -> [ControlPattern] -> ControlPattern
weave' Time -> Pattern a -> [Pattern a -> Pattern a] -> Pattern a
weaveWith Time -> Pattern a -> [Pattern a -> Pattern a] -> Pattern a

Sound.Tidal.UI

Function Type Marked
_degradeBy Double -> Pattern a -> Pattern a
_distrib [Int] -> Pattern a -> Pattern a
_euclid Int -> Int -> Pattern a -> Pattern a
_euclid' Int -> Int -> Pattern a -> Pattern a
_euclidBool Int -> Int -> Pattern Bool
_euclidFull Int -> Int -> Pattern a -> Pattern a -> Pattern a
_euclidInv Int -> Int -> Pattern a -> Pattern a
_euclidOff Int -> Int -> Integer -> Pattern a -> Pattern a
_euclidOffBool Int -> Int -> Integer -> Pattern Bool -> Pattern Bool
_iter Int -> Pattern a -> Pattern a
_iter' Int -> Pattern a -> Pattern a
_linger Time -> Pattern a -> Pattern a
_off Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
_ply Int -> Pattern a -> Pattern a
_range (Functor f, Num b) => b -> b -> f b -> f b
_rot Ord a => Int -> Pattern a -> Pattern a
_segment Time -> Pattern a -> Pattern a
_select Double -> [Pattern a] -> Pattern a
_stripe Int -> Pattern a -> Pattern a
_trunc Time -> Pattern a -> Pattern a
_unDegradeBy Double -> Pattern a -> Pattern a
almostAlways (Pattern a -> Pattern a) -> Pattern a -> Pattern a
almostNever (Pattern a -> Pattern a) -> Pattern a -> Pattern a
always (Pattern a -> Pattern a) -> Pattern a -> Pattern a
arpeggiate Pattern a -> Pattern a
arpg Pattern a -> Pattern a
brak Pattern a -> Pattern a
choose [a] -> Pattern a
chooseBy Pattern Double -> [a] -> Pattern a
chunk Integer -> (Pattern b -> Pattern b) -> Pattern b -> Pattern b TODO
chunk' Integral a => a -> (Pattern b -> Pattern b) -> Pattern b -> Pattern b
contrast (ControlPattern -> ControlPattern) -> (ControlPattern -> ControlPattern) -> ControlPattern -> ControlPattern -> ControlPattern TODO
contrastBy (a -> Value -> Bool) -> (ControlPattern -> Pattern b) -> (ControlPattern -> Pattern b) -> Pattern (containers-0.5.7.1:Data.Map.Base.Map String a) -> Pattern (containers-0.5.7.1:Data.Map.Base.Map String Value) -> Pattern b TODO
contrastRange (ControlPattern -> Pattern a) -> (ControlPattern -> Pattern a) -> Pattern (containers-0.5.7.1:Data.Map.Base.Map String (Value, Value)) -> ControlPattern -> Pattern a TODO
cycleChoose [a] -> Pattern a TODO
degrade Pattern a -> Pattern a
degradeBy Pattern Double -> Pattern a -> Pattern a
degradeOverBy Int -> Pattern Double -> Pattern a -> Pattern a TODO
discretise Pattern Time -> Pattern a -> Pattern a
distrib [Pattern Int] -> Pattern a -> Pattern a TODO
double Time -> Pattern a -> Pattern a TODO
echo Time -> Pattern a -> Pattern a TODO
enclosingArc [Arc] -> Arc
euclid Pattern Int -> Pattern Int -> Pattern a -> Pattern a TODO
euclidFull Pattern Int -> Pattern Int -> Pattern a -> Pattern a -> Pattern a TODO
euclidInv Pattern Int -> Pattern Int -> Pattern a -> Pattern a TODO
euclidOff Pattern Int -> Pattern Int -> Pattern Integer -> Pattern a -> Pattern a TODO
euclidOffBool Pattern Int -> Pattern Int -> Pattern Integer -> Pattern Bool -> Pattern Bool TODO
fadeIn Time -> Pattern a -> Pattern a TODO
fadeInFrom Time -> Time -> Pattern a -> Pattern a TODO
fadeOut Time -> Pattern a -> Pattern a TODO
fadeOutFrom Time -> Time -> Pattern a -> Pattern a TODO
fastspread (a -> t -> Pattern b) -> [a] -> t -> Pattern b TODO
fit Int -> [a] -> Pattern Int -> Pattern a
fit' Pattern Time -> Int -> Pattern Int -> Pattern Int -> Pattern a -> Pattern a
fix (ControlPattern -> ControlPattern) -> ControlPattern -> ControlPattern -> ControlPattern
fixRange (ControlPattern -> Pattern ControlMap) -> Pattern (containers-0.5.7.1:Data.Map.Base.Map String (Value, Value)) -> ControlPattern -> Pattern ControlMap TODO
flatpat Pattern [a] -> Pattern a TODO
ghost Pattern ControlMap -> Pattern ControlMap TODO
ghost' Time -> Pattern ControlMap -> Pattern ControlMap
ghost'' Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
ifp (Int -> Bool) -> (Pattern a -> Pattern a) -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
index Real b => b -> Pattern b -> Pattern c -> Pattern c TODO
inhabit [(String, Pattern a)] -> Pattern String -> Pattern a TODO
inside Pattern Time -> (Pattern a1 -> Pattern a) -> Pattern a1 -> Pattern a TODO
inv Functor f => f Bool -> f Bool TODO
irand Num a => Int -> Pattern a
iter Pattern Int -> Pattern c -> Pattern c
iter' Pattern Int -> Pattern c -> Pattern c
jux (Pattern ControlMap -> Pattern ControlMap) -> Pattern ControlMap -> Pattern ControlMap
jux' [t -> Pattern ControlMap] -> t -> Pattern ControlMap TODO
jux4 (Pattern ControlMap -> Pattern ControlMap) -> Pattern ControlMap -> Pattern ControlMap remove?
juxBy Pattern Double -> (Pattern ControlMap -> Pattern ControlMap) -> Pattern ControlMap -> Pattern ControlMap
juxcut (Pattern ControlMap -> Pattern ControlMap) -> Pattern ControlMap -> Pattern ControlMap TODO
juxcut' [t -> Pattern ControlMap] -> t -> Pattern ControlMap
layer [a -> Pattern b] -> a -> Pattern b TODO
lindenmayer Int -> String -> String -> String TODO
lindenmayerI Num b => Int -> String -> String -> [b]
linger Pattern Time -> Pattern a -> Pattern a
loopFirst Pattern a -> Pattern a TODO
mask Pattern Bool -> Pattern a -> Pattern a
never (Pattern a -> Pattern a) -> Pattern a -> Pattern a
off Pattern Time -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a TODO
offadd Num a => Pattern Time -> Pattern a -> Pattern a -> Pattern a deprecate?
often (Pattern a -> Pattern a) -> Pattern a -> Pattern a
outside Pattern Time -> (Pattern a1 -> Pattern a) -> Pattern a1 -> Pattern a TODO
palindrome Pattern a -> Pattern a
parseLMRule String -> [(String, String)] TODO
parseLMRule' String -> [(Char, String)]
permstep RealFrac b => Int -> [a] -> Pattern b -> Pattern a
pick String -> Int -> String deprecate?
ply Pattern Int -> Pattern a -> Pattern a
quad Time -> Pattern a -> Pattern a TODO
quantise (Functor f, RealFrac b) => b -> f b -> f b TODO
rand Fractional a => Pattern a
randArcs Int -> Pattern [Arc] TODO
randStruct Int -> Pattern Int TODO
randcat [Pattern a] -> Pattern a
range Num a => Pattern a -> Pattern a -> Pattern a -> Pattern a
rangex (Functor f, Floating b) => b -> b -> f b -> f b
rarely (Pattern a -> Pattern a) -> Pattern a -> Pattern a
revArc Arc -> Pattern a -> Pattern a TODO
rot Ord a => Pattern Int -> Pattern a -> Pattern a
runWith Integer -> (Pattern b -> Pattern b) -> Pattern b -> Pattern b TODO
runWith' Integral a => a -> (Pattern b -> Pattern b) -> Pattern b -> Pattern b
samples Applicative f => f String -> f Int -> f String deprecate?
samples' Applicative f => f String -> f Int -> f String
scramble Int -> Pattern a -> Pattern a
segment Pattern Time -> Pattern a -> Pattern a
select Pattern Double -> [Pattern a] -> Pattern a
seqP [(Time, Time, Pattern a)] -> Pattern a
seqPLoop [(Time, Time, Pattern a)] -> Pattern a
sew Pattern Bool -> Pattern a -> Pattern a -> Pattern a TODO
shuffle Int -> Pattern a -> Pattern a
slowspread (a -> t -> Pattern b) -> [a] -> t -> Pattern b TODO
slowstripe Pattern Int -> Pattern a -> Pattern a TODO
someCycles (Pattern a -> Pattern a) -> Pattern a -> Pattern a
someCyclesBy Double -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
somecycles (Pattern a -> Pattern a) -> Pattern a -> Pattern a
somecyclesBy Double -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
sometimes (Pattern a -> Pattern a) -> Pattern a -> Pattern a
sometimesBy Pattern Double -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
spaceOut [Time] -> Pattern a -> Pattern a TODO
spread (a -> t -> Pattern b) -> [a] -> t -> Pattern b TODO
spread' Monad m => (a -> b -> m c) -> m a -> b -> m c
spreadChoose (t -> t1 -> Pattern b) -> [t] -> t1 -> Pattern b TODO
spreadf [a -> Pattern b] -> a -> Pattern b TODO
spreadr (t -> t1 -> Pattern b) -> [t] -> t1 -> Pattern b TODO
stackwith Sound.Tidal.Context.Unionable a => Pattern a -> [Pattern a] -> Pattern a TODO
step String -> String -> Pattern String TODO
step' [String] -> String -> Pattern String
steps [(String, String)] -> Pattern String TODO
stretch Pattern a -> Pattern a TODO
stripe Pattern Int -> Pattern a -> Pattern a
struct Pattern Bool -> Pattern a -> Pattern a
stutter Integral i => i -> Time -> Pattern a -> Pattern a TODO
substruct Pattern String -> Pattern b -> Pattern b TODO
substruct' Pattern Int -> Pattern a -> Pattern a
superimpose (Pattern a -> Pattern a) -> Pattern a -> Pattern a
swing Pattern Time -> Pattern a -> Pattern a
swingBy Pattern Time -> Pattern Time -> Pattern a -> Pattern a
tabby Integer -> Pattern a -> Pattern a -> Pattern a TODO
timeLoop Pattern Time -> Pattern a -> Pattern a TODO
timeToRand RealFrac a => a -> Double TODO
toScale Num a => [a] -> Pattern Int -> Pattern a TODO
toScale' Num a => Int -> [a] -> Pattern Int -> Pattern a
triple Time -> Pattern a -> Pattern a TODO
trunc Pattern Time -> Pattern a -> Pattern a
unDegradeBy Pattern Double -> Pattern a -> Pattern a TODO
unfix (ControlPattern -> ControlPattern) -> ControlPattern -> ControlPattern -> ControlPattern TODO
unfixRange (ControlPattern -> Pattern ControlMap) -> Pattern(containers-0.5.7.1:Data.Map.Base.Map String (Value, Value)) -> ControlPattern -> Pattern ControlMap TODO
unwrap' Pattern (Pattern a) -> Pattern a
ur Time -> Pattern String -> [(String, Pattern a)] -> [(String, Pattern a -> Pattern a)] -> Pattern a
wchoose [(a, Double)] -> Pattern a
wchooseBy Pattern Double -> [(a, Double)] -> Pattern a
wedge Time -> Pattern a -> Pattern a -> Pattern a
whenmod Int -> Int -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
within Arc -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a
within' Arc -> (Pattern a -> Pattern a) -> Pattern a -> Pattern a


Sound.Tidal.Pattern

I think all the below are fine as 'internal use only' Yaxu (talk) 21:33, 5 December 2018 (UTC)

Function Type Marked
(*>) Pattern (a -> b) -> Pattern a -> Pattern b
(<*) Pattern (a -> b) -> Pattern a -> Pattern b
__compress Arc -> Pattern a -> Pattern a
__compressTo Arc -> Pattern a -> Pattern a
_fastGap Time -> Pattern a -> Pattern a
applyFIS (Double -> Double) -> (Int -> Int) -> (String -> String) -> Value -> Value
arcCycles Arc -> [Arc]
arcCyclesZW Arc -> [Arc]
compareDefrag (Eq a, Ord a) => [Event a] -> [Event a] -> Bool
cycleArcsInArc Arc -> [Arc]
cyclePos Time -> Time
cyclesInArc Integral a => Arc -> [a]
defragParts Eq a => [Event a] -> [Event a]
empty Pattern a
eventHasOnset Event a -> Bool
eventPart Event a -> Arc
eventValue Event a -> a
eventWhole Event a -> Arc
eventWholeOnset Event a -> Time
fNum2 (Int -> Int -> Int) -> (Double -> Double -> Double) -> Value -> Value -> Value
filterJust Pattern (Maybe a) -> Pattern a
filterValues (a -> Bool) -> Pattern a -> Pattern a
filterWhen (Time -> Bool) -> Pattern a -> Pattern a
getF Value -> Maybe Double
getI Value -> Maybe Int
getS Value -> Maybe String
innerJoin Pattern (Pattern a) -> Pattern a
isAdjacent Eq a => Event a -> Event a -> Bool
isAnalog Pattern a -> Bool
isDigital Pattern a -> Bool
isIn Arc -> Time -> Bool
mapArc (Time -> Time) -> Arc -> Arc
mapCycle (Time -> Time) -> Arc -> Arc
matchManyToOne (b -> a -> Bool) -> Pattern a -> Pattern b -> Pattern (Bool, b)
nextSam Time -> Time
noOv String -> a
onsetIn Arc -> Event a -> Bool
outerJoin Pattern (Pattern a) -> Pattern a
playFor Time -> Time -> Pattern a -> Pattern a
prettyRat Rational -> String
queryArc Pattern a -> Arc -> [Event a]
rotL Time -> Pattern a -> Pattern a
rotR Time -> Pattern a -> Pattern a
sam Time -> Time
showFrac Integer -> Integer -> String
showPattern Show a => Arc -> Pattern a -> String
splitQueries Pattern a -> Pattern a
subArc Arc -> Arc -> Maybe Arc
tParam (t1 -> t2 -> Pattern a) -> Pattern t1 -> t2 -> Pattern a
tParam2 (a -> b -> c -> Pattern d) -> Pattern a -> Pattern b -> c -> Pattern d
tParam3 (a -> b -> c -> Pattern d -> Pattern e) -> Pattern a -> Pattern b -> Pattern c -> Pattern d -> Pattern e
tParamSqueeze (a -> Pattern b -> Pattern c) -> Pattern a -> Pattern b -> Pattern c
timeToCycleArc Time -> Arc
toTime Real a => a -> Rational
unwrap Pattern (Pattern a) -> Pattern a
unwrapSqueeze Pattern (Pattern a) -> Pattern a
withEvent (Event a -> Event b) -> Pattern a -> Pattern b
withEvents ([Event a] -> [Event b]) -> Pattern a -> Pattern b
withPart (Arc -> Arc) -> Pattern a -> Pattern a
withQueryArc (Arc -> Arc) -> Pattern a -> Pattern a
withQueryTime (Time -> Time) -> Pattern a -> Pattern a
withResultArc (Arc -> Arc) -> Pattern a -> Pattern a
withResultTime (Time -> Time) -> Pattern a -> Pattern a

How the above lists were made

The ghci :browse command, some by-hand fixing up (removing stray carriage returns), and the following perl one-liner:

perl -pe 's!(.*?)\s*::\s*(.*)!|-\n|[[$1]]\n|<code>$2</code>!'