From c5a6ba9477f7d862b6357597ad6cfb86420bc3be Mon Sep 17 00:00:00 2001 From: Eric Conlon <37287+ejconlon@users.noreply.github.com> Date: Sat, 17 Feb 2024 11:59:27 -0800 Subject: [PATCH] etc --- minipat-dirt/src/Minipat/Dirt/Attrs.hs | 61 +++++++++- minipat-dirt/src/Minipat/Dirt/Boot.hs | 12 +- minipat-dirt/src/Minipat/Dirt/Core.hs | 138 +++++++++++++++++------ minipat-dirt/src/Minipat/Dirt/Notes.hs | 2 +- minipat-dirt/src/Minipat/Dirt/Osc.hs | 61 ++++++---- minipat-dirt/src/Minipat/Dirt/Prelude.hs | 10 +- minipat-dirt/src/Minipat/Dirt/Test.hs | 6 +- minipat/src/Minipat/Print.hs | 12 ++ minipat/src/Minipat/Stream.hs | 45 +++++--- minipat/src/Minipat/Time.hs | 8 ++ minipat/test/Main.hs | 8 +- 11 files changed, 273 insertions(+), 90 deletions(-) diff --git a/minipat-dirt/src/Minipat/Dirt/Attrs.hs b/minipat-dirt/src/Minipat/Dirt/Attrs.hs index 645192f..cb76029 100644 --- a/minipat-dirt/src/Minipat/Dirt/Attrs.hs +++ b/minipat-dirt/src/Minipat/Dirt/Attrs.hs @@ -5,8 +5,14 @@ module Minipat.Dirt.Attrs , datumProxyType , Attr (..) , Attrs - , attrs + , attrsSingleton + , attrsFromList + , attrsLookup + , attrsInsert + , attrsDelete + , attrsToList , IsAttrs (..) + , attrsMerge ) where @@ -17,6 +23,8 @@ import Data.Map.Strict qualified as Map import Data.Text (Text) import Minipat.Ast (Ident (..)) import Minipat.Dirt.Notes (Note (..)) +import Prettyprinter (Doc, Pretty (..)) +import Prettyprinter qualified as P data Sound = Sound { soundIdent :: !Ident @@ -39,16 +47,54 @@ datumProxyType = \case DatumProxyDouble -> DatumTypeDouble DatumProxyString -> DatumTypeString +prettyDatum :: Datum -> Doc ann +prettyDatum = \case + DatumInt32 x -> pretty x + DatumInt64 x -> pretty x + DatumFloat x -> pretty x + DatumDouble x -> pretty x + DatumString x -> pretty x + DatumBlob _ -> "" + DatumTime _ -> "