]> Git — Sourcephile - reloto.git/commitdiff
Rename Htirage -> Relotophile master
authorJulien Moutinho <julm@sourcephile.fr>
Sat, 14 Mar 2020 05:43:06 +0000 (06:43 +0100)
committerJulien Moutinho <julm@sourcephile.fr>
Thu, 19 Mar 2020 21:05:36 +0000 (22:05 +0100)
14 files changed:
GNUmakefile
Htirage.hs [deleted file]
Relotophile.hs [new file with mode: 0644]
Relotophile/Bits.hs [moved from Htirage/Bits.hs with 98% similarity]
Relotophile/Combin.hs [moved from Htirage/Combin.hs with 98% similarity]
Relotophile/Draw.hs [moved from Htirage/Draw.hs with 87% similarity]
Relotophile/HLint.hs [moved from Htirage/HLint.hs with 100% similarity]
Relotophile/Random.hs [moved from Htirage/Random.hs with 95% similarity]
Relotophile/Sequence.hs [moved from Htirage/Sequence.hs with 97% similarity]
Relotophile/Tutorial.lhs [moved from Htirage/Tutorial.lhs with 95% similarity]
relotophile.cabal [moved from htirage.cabal with 72% similarity]
stack.yaml
test/Main.hs
test/QuickCheck.hs

index d35a9e1fc02b1df644dd7528fb16b0b144d7c715..e8427882e4cd456716db5d93f5febf838c6de9fe 100644 (file)
@@ -36,7 +36,7 @@ doc:
 HLint.hs: $(shell find . -name '*.hs' -not -name 'HLint.hs')
        sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
        echo '-- BEGIN: generated hints' >> HLint.hs
 HLint.hs: $(shell find . -name '*.hs' -not -name 'HLint.hs')
        sed -i -e '/^-- BEGIN: generated hints/,/^-- END: Generated by hlint/d' HLint.hs
        echo '-- BEGIN: generated hints' >> HLint.hs
-       hlint --find . | grep '^'infix | sort -u >> HLint.hs
+       hlint --find . | sed -ne 's/^- infix: \(.*\)/\1/p' | sort -u >>HLint.hs
        echo '-- END: generated hints' >> HLint.hs
 
 lint: HLint.hs
        echo '-- END: generated hints' >> HLint.hs
 
 lint: HLint.hs
diff --git a/Htirage.hs b/Htirage.hs
deleted file mode 100644 (file)
index 3ba67be..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
--- | Tirage au sort équiprobable par aléa publiquement vérifiable.
-module Htirage
- ( module Htirage.Bits
- , module Htirage.Combin
- , module Htirage.Sequence
- , module Htirage.Draw
- , module Htirage.Random
- ) where
-
-import Htirage.Bits
-import Htirage.Combin
-import Htirage.Sequence
-import Htirage.Draw
-import Htirage.Random
diff --git a/Relotophile.hs b/Relotophile.hs
new file mode 100644 (file)
index 0000000..39c4d46
--- /dev/null
@@ -0,0 +1,14 @@
+-- | Tirage au sort équiprobable par aléa publiquement vérifiable.
+module Relotophile
+ ( module Relotophile.Bits
+ , module Relotophile.Combin
+ , module Relotophile.Sequence
+ , module Relotophile.Draw
+ , module Relotophile.Random
+ ) where
+
+import Relotophile.Bits
+import Relotophile.Combin
+import Relotophile.Sequence
+import Relotophile.Draw
+import Relotophile.Random
similarity index 98%
rename from Htirage/Bits.hs
rename to Relotophile/Bits.hs
index 53906c1c8ba32750d976c608e5ece2adc7fa5aa4..9f688c84954689dce8d8d576ab446ada922eb26d 100644 (file)
@@ -1,5 +1,5 @@
 -- | Manipulation de bits.
 -- | Manipulation de bits.
-module Htirage.Bits where
+module Relotophile.Bits where
 
 import Data.Bool
 import Data.Eq (Eq(..))
 
 import Data.Bool
 import Data.Eq (Eq(..))
similarity index 98%
rename from Htirage/Combin.hs
rename to Relotophile/Combin.hs
index ccb0e141d6476f0aa271ff0feca9fa525141e3d5..b51002202894596c9580b040439fb01ab33b0f9b 100644 (file)
@@ -1,5 +1,5 @@
 -- | Calculs de combinaisons.
 -- | Calculs de combinaisons.
-module Htirage.Combin where
+module Relotophile.Combin where
 
 import Data.Bool
 import Data.Eq (Eq(..))
 
 import Data.Bool
 import Data.Eq (Eq(..))
similarity index 87%
rename from Htirage/Draw.hs
rename to Relotophile/Draw.hs
index cee7f44121720f701f7df8b43cea962ce8d773cb..c34cc66a8cb48de203400dff60993d5394317fa2 100644 (file)
@@ -1,13 +1,13 @@
 -- | Tirages.
 -- | Tirages.
-module Htirage.Draw where
+module Relotophile.Draw where
 
 import Data.Bool
 import Prelude (Integer, Integral(..), Num(..))
 import Data.List (length, map)
 
 
 import Data.Bool
 import Prelude (Integer, Integral(..), Num(..))
 import Data.List (length, map)
 
-import Htirage.Bits
-import Htirage.Combin
-import Htirage.Sequence
+import Relotophile.Bits
+import Relotophile.Combin
+import Relotophile.Sequence
 
 -- | @unorderedDraw k xs bs@ retourne 'k' choix (sans ordre ni répétition) parmi 'xs'
 -- déterminés par l’entropie 'bs'.
 
 -- | @unorderedDraw k xs bs@ retourne 'k' choix (sans ordre ni répétition) parmi 'xs'
 -- déterminés par l’entropie 'bs'.
similarity index 100%
rename from Htirage/HLint.hs
rename to Relotophile/HLint.hs
similarity index 95%
rename from Htirage/Random.hs
rename to Relotophile/Random.hs
index 024d5dc78a621b0d1db5584fcc5e816c2302546d..63934bf8bdaaa0ab6c9d53ee6f6e5590100bd328 100644 (file)
@@ -9,7 +9,7 @@
 -- Car il n’y a que @2^n@ combinaisons de @n@ bits.
 -- Et que parmi ces combinaisons un bit a une probabilité
 -- de @2^(n-1)@ sur @2^n@ soit de @1/2@ d’être à 'True', et autant d’être à 'False'.
 -- Car il n’y a que @2^n@ combinaisons de @n@ bits.
 -- Et que parmi ces combinaisons un bit a une probabilité
 -- de @2^(n-1)@ sur @2^n@ soit de @1/2@ d’être à 'True', et autant d’être à 'False'.
-module Htirage.Random where
+module Relotophile.Random where
 
 import Data.Bool
 import Data.Eq (Eq(..))
 
 import Data.Bool
 import Data.Eq (Eq(..))
@@ -19,9 +19,9 @@ import Data.List ((++), length, nub, sort)
 import Data.Ord (Ord(..))
 import Prelude (Integer, Num(..), undefined, (^))
 
 import Data.Ord (Ord(..))
 import Prelude (Integer, Num(..), undefined, (^))
 
-import Htirage.Bits
-import Htirage.Combin
-import Htirage.Sequence
+import Relotophile.Bits
+import Relotophile.Combin
+import Relotophile.Sequence
 
 -- | @equiprobableBits n@ retourne le nombre maximal de bits de 'i'
 -- équiprobables quand @i@ parcourt @[0..n-1]@.
 
 -- | @equiprobableBits n@ retourne le nombre maximal de bits de 'i'
 -- équiprobables quand @i@ parcourt @[0..n-1]@.
@@ -123,6 +123,8 @@ randomOf6aus49 (n1,n2,n3,n4,n5,n6) nc = randomOfCombin 49 6 [n1,n2,n3,n4,n5,n6]
 randomOfEuroMillions :: (Integer,Integer,Integer,Integer,Integer) -> (Integer,Integer) -> [Bool]
 randomOfEuroMillions (n1,n2,n3,n4,n5) (nc1,nc2) = randomOfCombin 50 5 [n1,n2,n3,n4,n5] ++
                                                   randomOfCombin 12 2 [nc1,nc2]
 randomOfEuroMillions :: (Integer,Integer,Integer,Integer,Integer) -> (Integer,Integer) -> [Bool]
 randomOfEuroMillions (n1,n2,n3,n4,n5) (nc1,nc2) = randomOfCombin 50 5 [n1,n2,n3,n4,n5] ++
                                                   randomOfCombin 12 2 [nc1,nc2]
+-- | @34@ bits équiprobables en allant voir l’ordre du tirage :
+-- @'sum' $ 'equiprobableBits' '<$>' [50\`nAk\`5, 12\`nAk\`2]@
 randomOfOrderedEuroMillions :: (Integer,Integer,Integer,Integer,Integer) -> (Integer,Integer) -> [Bool]
 randomOfOrderedEuroMillions (n1,n2,n3,n4,n5) (nc1,nc2) = randomOfSequence 50 5 [n1,n2,n3,n4,n5] ++
                                                          randomOfSequence 12 2 [nc1,nc2]
 randomOfOrderedEuroMillions :: (Integer,Integer,Integer,Integer,Integer) -> (Integer,Integer) -> [Bool]
 randomOfOrderedEuroMillions (n1,n2,n3,n4,n5) (nc1,nc2) = randomOfSequence 50 5 [n1,n2,n3,n4,n5] ++
                                                          randomOfSequence 12 2 [nc1,nc2]
@@ -150,6 +152,8 @@ randomOfOrderedEuroMillions (n1,n2,n3,n4,n5) (nc1,nc2) = randomOfSequence 50 5 [
 randomOfFrenchLoto :: (Integer,Integer,Integer,Integer,Integer) -> Integer -> [Bool]
 randomOfFrenchLoto (n1,n2,n3,n4,n5) nc = randomOfCombin 49 5 [n1,n2,n3,n4,n5] ++
                                          randomOfCombin 10 1 [nc]
 randomOfFrenchLoto :: (Integer,Integer,Integer,Integer,Integer) -> Integer -> [Bool]
 randomOfFrenchLoto (n1,n2,n3,n4,n5) nc = randomOfCombin 49 5 [n1,n2,n3,n4,n5] ++
                                          randomOfCombin 10 1 [nc]
+-- | @30@ bits équiprobables en allant voir l’ordre du tirage :
+-- @'sum' $ 'equiprobableBits' '<$>' [49\`nAk\`5, 10\`nAk\`1]@
 randomOfOrderedFrenchLoto :: (Integer,Integer,Integer,Integer,Integer) -> Integer -> [Bool]
 randomOfOrderedFrenchLoto (n1,n2,n3,n4,n5) nc = randomOfSequence 49 5 [n1,n2,n3,n4,n5] ++
                                                 randomOfSequence 10 1 [nc]
 randomOfOrderedFrenchLoto :: (Integer,Integer,Integer,Integer,Integer) -> Integer -> [Bool]
 randomOfOrderedFrenchLoto (n1,n2,n3,n4,n5) nc = randomOfSequence 49 5 [n1,n2,n3,n4,n5] ++
                                                 randomOfSequence 10 1 [nc]
similarity index 97%
rename from Htirage/Sequence.hs
rename to Relotophile/Sequence.hs
index 90abaa8e35aba0f0d94f422ec83f8ea7a0f96a74..15adbcfef60ab27c5a912f7b152ff62d077b39d1 100644 (file)
@@ -1,5 +1,5 @@
 -- | Calculs d’arrangements.
 -- | Calculs d’arrangements.
-module Htirage.Sequence where
+module Relotophile.Sequence where
 
 import Data.Bool
 import Data.Foldable (any, foldr)
 
 import Data.Bool
 import Data.Foldable (any, foldr)
similarity index 95%
rename from Htirage/Tutorial.lhs
rename to Relotophile/Tutorial.lhs
index 9213fa21c14e87aae380ce07885cd4498e18edf1..5d610e1298b53bd9ad864d18579e6ea70e4a2a8b 100644 (file)
@@ -4,8 +4,8 @@ Tutoriel de htirage
 On commence par les entêtes nécessaires au compilateur :
 
 > {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
 On commence par les entêtes nécessaires au compilateur :
 
 > {-# OPTIONS_GHC -fno-warn-missing-signatures #-}
-> module Htirage.Tutorial where
-> import Htirage
+> module Relotophile.Tutorial where
+> import Relotophile
 > import Prelude (toInteger)
 > import Data.List ((++), length, sort)
 
 > import Prelude (toInteger)
 > import Data.List ((++), length, sort)
 
similarity index 72%
rename from htirage.cabal
rename to relotophile.cabal
index a122d7a1bea5b21f358ccf084e9868e7e6bdc2aa..d95aa41497971e768398e01d8636ac209845f30b 100644 (file)
@@ -1,4 +1,4 @@
-name: htirage
+name: relotophile
 -- PVP:  +-+------- breaking API changes
 --       | | +----- non-breaking API additions
 --       | | | +--- code changes with no API change
 -- PVP:  +-+------- breaking API changes
 --       | | +----- non-breaking API additions
 --       | | | +--- code changes with no API change
@@ -10,30 +10,30 @@ extra-doc-files:
 license: GPL-3
 license-file: COPYING
 stability: experimental
 license: GPL-3
 license-file: COPYING
 stability: experimental
-author:      Julien Moutinho <julm+htirage@autogeree.net>
-maintainer:  Julien Moutinho <julm+htirage@autogeree.net>
-bug-reports: Julien Moutinho <julm+htirage@autogeree.net>
+author:      Julien Moutinho <julm+relotophile@autogeree.net>
+maintainer:  Julien Moutinho <julm+relotophile@autogeree.net>
+bug-reports: Julien Moutinho <julm+relotophile@autogeree.net>
 
 build-type: Simple
 cabal-version: >= 1.10
 
 build-type: Simple
 cabal-version: >= 1.10
-tested-with: GHC==8.4.3
+tested-with: GHC==8.6.5
 extra-source-files:
   stack.yaml
 extra-tmp-files:
 
 source-repository head
 extra-source-files:
   stack.yaml
 extra-tmp-files:
 
 source-repository head
- location: git://git.autogeree.net/htirage
+ location: git://git.autogeree.net/relotophile
  type:     git
 
 Library
   exposed-modules:
  type:     git
 
 Library
   exposed-modules:
-    Htirage
-    Htirage.Bits
-    Htirage.Combin
-    Htirage.Draw
-    Htirage.Random
-    Htirage.Sequence
-    Htirage.Tutorial
+    Relotophile
+    Relotophile.Bits
+    Relotophile.Combin
+    Relotophile.Draw
+    Relotophile.Random
+    Relotophile.Sequence
+    Relotophile.Tutorial
   default-language: Haskell2010
   default-extensions:
     NoImplicitPrelude
   default-language: Haskell2010
   default-extensions:
     NoImplicitPrelude
@@ -46,7 +46,7 @@ Library
   build-depends:
     base >= 4.6 && < 5
 
   build-depends:
     base >= 4.6 && < 5
 
-Test-Suite htirage-test
+Test-Suite relotophile-test
   type: exitcode-stdio-1.0
   default-language: Haskell2010
   default-extensions:
   type: exitcode-stdio-1.0
   default-language: Haskell2010
   default-extensions:
@@ -56,7 +56,7 @@ Test-Suite htirage-test
   other-modules:
     QuickCheck
   build-depends:
   other-modules:
     QuickCheck
   build-depends:
-      htirage
+      relotophile
     , base         >= 4.6 && < 5
     , containers   >= 0.5
     , QuickCheck   >= 2.0
     , base         >= 4.6 && < 5
     , containers   >= 0.5
     , QuickCheck   >= 2.0
index 21adc4a927dab9a3b7792fb1e0a175f1ea3b64f3..7131b773fc41ca23058aa8837fc53d2448006fb1 100644 (file)
@@ -1,3 +1 @@
-resolver: lts-12.25
-packages:
-- '.'
+resolver: lts-15.3
index bad16d490f3c5156b36e130d0ef238535e7b4068..4fbd8e0ba3ddc3254132d62de9d0c4c18bbd2ccc 100644 (file)
@@ -6,6 +6,6 @@ import QuickCheck
 main :: IO ()
 main =
        defaultMain $
 main :: IO ()
 main =
        defaultMain $
-       testGroup "Htirage"
+       testGroup "Relotophile"
         [ quickchecks
         ]
         [ quickchecks
         ]
index 509bfe5becff695f7469261c9fcd95530a4f57c8..4fc0a35bee891b7f4fad3e3f3e9a6f11f90cb9ec 100644 (file)
@@ -10,7 +10,7 @@ import Test.Tasty.QuickCheck
 import qualified Data.List as List
 import qualified Data.Set as Set
 
 import qualified Data.List as List
 import qualified Data.Set as Set
 
-import Htirage
+import Relotophile
 
 quickchecks :: TestTree
 quickchecks =
 
 quickchecks :: TestTree
 quickchecks =