zmidi-core 0.2.0 → 0.2.1
raw patch · 12 files changed
+59/−23 lines, 12 filessetup-changed
Files
- CHANGES +6/−0
- Setup.hs +26/−1
- demo/MidiPrint.hs +1/−2
- src/ZMidi/Core.hs +1/−1
- src/ZMidi/Core/Datatypes.hs +6/−6
- src/ZMidi/Core/Internal/ParserMonad.hs +1/−1
- src/ZMidi/Core/Internal/SimpleFormat.hs +2/−2
- src/ZMidi/Core/Pretty.hs +2/−2
- src/ZMidi/Core/ReadFile.hs +3/−3
- src/ZMidi/Core/VersionNumber.hs +3/−3
- src/ZMidi/Core/WriteFile.hs +1/−1
- zmidi-core.cabal +7/−1
CHANGES view
@@ -1,4 +1,10 @@ +0.2.0 to 0.2.1:++ * Added Show class constraints to various type signatures to + accommodate changes to Num superclass hierarchy in GHC 7.4.+ Thanks to Rémy Mouëza for the patches.+ 0.1.0 to 0.2.0: * Added a top-level /shim/ module to import all the exposed
Setup.hs view
@@ -1,4 +1,29 @@ #!/usr/bin/env runhaskell import Distribution.Simple-main = defaultMain+import Distribution.Simple.Setup ( SDistFlags )+import Distribution.PackageDescription ( HookedBuildInfo, emptyHookedBuildInfo )+++main = defaultMainWithHooks sdist_warning_hooks++sdist_warning_hooks :: UserHooks+sdist_warning_hooks = simpleUserHooks { preSDist = sdistVersionWarning }+++sdistVersionWarning :: Args -> SDistFlags -> IO HookedBuildInfo+sdistVersionWarning _ _ = + mapM_ putStrLn msg >> printVersionNumberFile >> return emptyHookedBuildInfo+ where+ msg = [ "-------------------------------------------------------"+ , "-------------------------------------------------------"+ , ""+ , "WARNING - is ZMidi.Core.VersionNumber correct?"+ , ""+ , "-------------------------------------------------------"+ , "-------------------------------------------------------"+ ]++printVersionNumberFile :: IO ()+printVersionNumberFile = + readFile "src/ZMidi/Core/VersionNumber.hs" >>= putStrLn
demo/MidiPrint.hs view
@@ -4,8 +4,7 @@ module Main where -import ZMidi.Core.Pretty-import ZMidi.Core.ReadFile+import ZMidi.Core import System.Environment
src/ZMidi/Core.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>
src/ZMidi/Core/Datatypes.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Datatypes--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -85,10 +85,10 @@ -- The header is the start of a MIDI file, it is indicated by the -- 4 character marker @MThd@. ---data Header = Header { - hdr_format :: Format,- num_tracks :: Word16,- time_division :: TimeDivision+data Header = Header + { hdr_format :: Format+ , num_tracks :: Word16+ , time_division :: TimeDivision } deriving (Eq,Show) @@ -516,5 +516,5 @@ | otherwise = V4 (down $ right21 i) (down $ right14 i) (down $ right7 i) (downl i) -hexStr :: (Integral a) => a -> String+hexStr :: (Show a, Integral a) => a -> String hexStr i = (showString "0x" . showHex i) ""
src/ZMidi/Core/Internal/ParserMonad.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Internal.ParseMonad--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>
src/ZMidi/Core/Internal/SimpleFormat.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Internal.SimpleFormat--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -114,5 +114,5 @@ | otherwise = Doc 4 (showHex n) -integral :: Integral a => a -> Doc+integral :: (Show a, Integral a) => a -> Doc integral = doc . show
src/ZMidi/Core/Pretty.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.Pretty--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -190,7 +190,7 @@ ppMetaEvent (SSME n ws) = event "sequencer-specific" (byteList n ws) -byteList :: Integral a => a -> [Word8] -> Doc +byteList :: (Show a, Integral a) => a -> [Word8] -> Doc byteList n ws | n < 10 = integral n `sep` mconcat (map hex2 ws) | otherwise = integral n `sep` multiply 10 '.'
src/ZMidi/Core/ReadFile.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.ReadFile--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>@@ -46,7 +46,7 @@ midiFile :: ParserM MidiFile -midiFile = {- printHexAll >> -} do+midiFile = do hdr <- header let i = trackCount hdr trks <- count i track@@ -237,7 +237,7 @@ where msg = "assertWord8 - input did not match " ++ show i -assertWord32 :: Integral a => a -> ParserM Word32+assertWord32 :: (Show a, Integral a) => a -> ParserM Word32 assertWord32 i = postCheck word32be ((==i) . fromIntegral) msg where msg = "assertWord32 - input did not match " ++ show i
src/ZMidi/Core/VersionNumber.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.VersionNumber--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : stephen.tetley@gmail.com@@ -22,7 +22,7 @@ -- | Version number ----- > (0,2,0)+-- > (0,2,1) -- zmidi_core_version :: (Int,Int,Int)-zmidi_core_version = (0,2,0)+zmidi_core_version = (0,2,1)
src/ZMidi/Core/WriteFile.hs view
@@ -3,7 +3,7 @@ -------------------------------------------------------------------------------- -- | -- Module : ZMidi.Core.WriteFile--- Copyright : (c) Stephen Tetley 2010+-- Copyright : (c) Stephen Tetley 2010-2012 -- License : BSD3 -- -- Maintainer : Stephen Tetley <stephen.tetley@gmail.com>
zmidi-core.cabal view
@@ -1,5 +1,5 @@ name: zmidi-core-version: 0.2.0+version: 0.2.1 license: BSD3 license-file: LICENSE copyright: Stephen Tetley <stephen.tetley@gmail.com>@@ -12,6 +12,12 @@ dependencies only on ByteString and Data.Binary. . Changelog:+ .+ v0.2.0 to v0.2.1:+ . + * Added Show class constraints to various type signatures to + accommodate changes to Num superclass hierarchy in GHC 7.4.+ Thanks to Remy Moueza for the patches. . v0.1.0 to v0.2.0: .