Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide contexts from Events per default #887

Merged
merged 2 commits into from Jan 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/Sound/Tidal/Show.hs
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