Skip to content

Commit

Permalink
Merge pull request #887 from polymorphicengine/main
Browse files Browse the repository at this point in the history
Hide contexts from Events per default
  • Loading branch information
yaxu committed Jan 6, 2022
2 parents 5bc8e81 + 7a1f4c5 commit d840106
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Sound/Tidal/Show.hs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ showEvent (Event _ Nothing a e) =

-- Show everything, including event context
showAll :: Show a => Arc -> Pattern a -> String
showAll a p = intercalate "\n" $ map show $ sortOn part $ queryArc p a
showAll a p = intercalate "\n" $ map showEventAll $ sortOn part $ queryArc p a

-- Show context of an event
showEventAll :: Show a => Event a -> String
showEventAll e = show (context e) ++ uncurry (++) (showEvent e)

instance Show Context where
show (Context cs) = show cs
Expand All @@ -93,7 +97,7 @@ instance {-# OVERLAPPING #-} Show Arc where
show (Arc s e) = prettyRat s ++ ">" ++ prettyRat e

instance {-# OVERLAPPING #-} Show a => Show (Event a) where
show e = show (context e) ++ uncurry (++) (showEvent e)
show e = uncurry (++) (showEvent e)

prettyRat :: Rational -> String
prettyRat r | unit == 0 && frac > 0 = showFrac (numerator frac) (denominator frac)
Expand Down

0 comments on commit d840106

Please sign in to comment.