packages feed

copilot-libraries 2.2.0 → 2.2.1

raw patch · 2 files changed

+10/−12 lines, 2 filesdep ~copilot-languagenew-uploaderPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: copilot-language

API changes (from Hackage documentation)

- Copilot.Library.Utils: (!!) :: (Typed a, Integral a) => [Stream a] -> Stream a -> Stream a
+ Copilot.Library.Utils: (!!) :: (Typed a, Eq b, Num b, Typed b) => [Stream a] -> Stream b -> Stream a

Files

copilot-libraries.cabal view
@@ -1,6 +1,6 @@ cabal-version:       >=1.10 name:                copilot-libraries-version:             2.2.0+version:             2.2.1 synopsis:            Libraries for the Copilot language. description:   Libraries for the Copilot language.@@ -12,13 +12,13 @@   <https://github.com/leepike/copilot-discussion>.   .   Examples are available at-  <https://github.com/leepike/Copilot/tree/master/Examples>.+  <https://github.com/Copilot-Language/Copilot/tree/master/Examples>.  license:             BSD3 license-file:        LICENSE author:              Lee Pike, Robin Morisset, Alwyn Goodloe, Sebastian Niller,                      Nis Nordby Wegmann-homepage:            https://github.com/leepike/copilot-libraries+homepage:            https://github.com/Copilot-Language/copilot-libraries maintainer:          leepike@gmail.com stability:           Experimental category:            Language, Embedded@@ -26,7 +26,7 @@  source-repository head     type:       git-    location:   git://github.com/leepike/copilot-libraries.git+    location:   git://github.com/Copilot-Language/copilot-libraries.git  library   default-language: Haskell2010@@ -37,7 +37,7 @@     array,     base >= 4.0 && <= 5.0,     containers,-    copilot-language == 2.2.0,+    copilot-language == 2.2.1,     parsec >= 2.0,     mtl >= 2.0 
src/Copilot/Library/Utils.hs view
@@ -1,4 +1,4 @@--- | +-- | -- Module: Utils -- Description: Utility bounded-list functions (e.g., folds, scans, etc.) -- Copyright: (c) 2011 National Institute of Aerospace / Galois, Inc.@@ -13,7 +13,7 @@          -- ** Scans          nscanl, nscanr, nscanl1, nscanr1,          -- ** Indexing-         case', (!!)) +         case', (!!)) where  import Copilot.Language@@ -83,11 +83,9 @@                    P.++ "greater by one than the length of predicates list"   in case'' predicates alternatives - -- | Index.  WARNING: Very expensive!  Consider using this only for very short -- lists.-(!!) :: ( Typed a, Integral a )-        => [ Stream a ] -> Stream a -> Stream a+(!!) :: (Typed a, Eq b, Num b, Typed b) => [Stream a] -> Stream b -> Stream a ls !! n = let indices      = map                              ( constant . fromIntegral )                              [ 0 .. P.length ls - 1 ]@@ -96,10 +94,10 @@                 ( i : is )                 ( x : xs ) = mux ( i == n ) x ( select is xs )                              -- should not happen-              select _ []  = badUsage ("in (!!) defined in Utils.hs " P.++ +              select _ []  = badUsage ("in (!!) defined in Utils.hs " P.++                                "in copilot-libraries")           in if null ls then-               badUsage ("in (!!) defined in Utils.hs " P.++ +               badUsage ("in (!!) defined in Utils.hs " P.++                             "indexing the empty list with !! is not defined")              else                select indices ls