Commit a91a991f authored by simonm's avatar simonm
Browse files

[project @ 1998-02-19 17:02:04 by simonm]

updates for library re-organisation in GHC 3.01.
parent bb74ed0d
......@@ -6,15 +6,13 @@ vectors.
\begin{haskell}{HmmDensities}
> module HmmDensities(
> module Native, module MathTypes, module Phones,
> module MathTypes, module Phones,
> GaussianComponent, TiedMixture(..), TmTable,
> LogDensityTable,
> eval_log_densities, readMixtures, readMixture, extern_to_intern
> ) where
> import Native -- hbc library modules
> --partain: import Maybe
> import Printf
> import Lists -- general library modules
> import MathTypes
......
......@@ -53,9 +53,9 @@ HS_OBJS = Alignments.o \
Viterbi.o \
BatchAlign.o
SRC_MKDEPENDHS_OPTS += -syslib hbc
SRC_MKDEPENDHS_OPTS += -syslib misc
SRC_RUNTEST_OPTS += -o2 HMMS.stderr hmms/h9 hmms/h9.ties hmms/h9.dgs sentences
SRC_HC_OPTS += -fglasgow-exts -syslib hbc
SRC_HC_OPTS += -fglasgow-exts -syslib misc
MaybeStateT_HC_OPTS += -cpp
BatchAlign_HC_OPTS += -cpp
......
module Encode (CodeEvent(..), encode, maxBits)
where
import GHC
import IOBase (trace) -- TEMP
import GlaExts
data PrefixTrie a b = PTNil |
PT a b (PrefixTrie a b) (PrefixTrie a b) (PrefixTrie a b)
......
module WriteRoutines (outputCodes)
where
import PrelBase
import GlaExts
import Encode (CodeEvent(..))
import IOBase -- TEMP
-- Start of code added for ghc
w2i x = word2Int# x
......
......@@ -9,6 +9,9 @@
-- Status : Unknown, Use with caution!
--
-- $Log: IOSupplement.hs,v $
-- Revision 1.5 1998/02/19 17:02:22 simonm
-- updates for library re-organisation in GHC 3.01.
--
-- Revision 1.4 1997/03/17 20:35:25 simonpj
-- More small changes towards 2.02
--
......@@ -36,7 +39,6 @@ module IOSupplement (
import System -- 1.3
import IO
import IOBase ( IOError, fail, userError )
--------------------------------------------------------------------------------
......
......@@ -7,7 +7,6 @@ import Comparing
import Memo
import Postscript
import Array -- 1.3
import ArrBase -- 1.3
-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- section 5: Hiding
......
......@@ -5,7 +5,6 @@ import Hide
import MyIO
import EdgePlate ( Input(..) ) -- partain
import Postscript ( Output(..) ) -- partain
import IOHandle -- 1.3
import IO -- 1.3
main =
......
......@@ -52,6 +52,7 @@ first understand binomial queues. See, for example, David King's
>module Main (main) where
>import ST
>import Array
>import MutableArray
>import System
--------------------
......@@ -109,9 +110,9 @@ is irrelevant.
> flatten (UnionBags b1 b2) xs = flatten b1 (flatten b2 xs)
>
>applyToAll :: (a -> ST s ()) -> Bag a -> ST s ()
>applyToAll f EmptyBag = returnST ()
>applyToAll f (ConsBag x b) = f x `seqST` applyToAll f b
>applyToAll f (UnionBags b1 b2) = applyToAll f b1 `seqST` applyToAll f b2
>applyToAll f EmptyBag = return ()
>applyToAll f (ConsBag x b) = f x >> applyToAll f b
>applyToAll f (UnionBags b1 b2) = applyToAll f b1 >> applyToAll f b2
--------------------
......@@ -190,10 +191,10 @@ In the first implementation, there are three steps.
> d = log2 (n-1) -- maximum possible degree
>
> ins a (i, t) =
> readArray a i `thenST` \e ->
> readArray a i >>= \e ->
> case e of
> Zero -> writeArray a i (One t)
> One t2 -> writeArray a i Zero `seqST`
> One t2 -> writeArray a i Zero >>
> ins a (i+1, link t t2)
Note that after inserting all the trees, the array contains trees
......@@ -202,15 +203,15 @@ highest order bit of n-1 is one, we know that there is a tree in
the highest slot of the array.
> getMin a =
> readArray a d `thenST` \e ->
> readArray a d >>= \e ->
> case e of
> Zero -> error "must be One" -- since array is filled as bits of n-1
> One t -> getMin' a d t EmptyBag 0
> getMin' a mini mint b i =
> if i >= d then
> returnST ((mini, mint),b)
> return ((mini, mint),b)
> else
> readArray a i `thenST` \e ->
> readArray a i >>= \e ->
> case e of
> Zero -> getMin' a mini mint b (i+1)
> One t -> if root mint <= root t then
......@@ -219,11 +220,11 @@ the highest slot of the array.
> getMin' a i t (ConsBag (mini, mint) b) (i+1)
>
> in
> runST (newArray (0,d) Zero `thenST` \a ->
> applyToAll (ins a) f `seqST`
> listST (map (ins a) (getChildren tt)) `seqST`
> getMin a `thenST` \ (tt,f) ->
> returnST (FH (n-1) tt f))
> runST (newArray (0,d) Zero >>= \a ->
> applyToAll (ins a) f >>
> sequence (map (ins a) (getChildren tt)) >>
> getMin a >>= \ (tt,f) ->
> return (FH (n-1) tt f))
--------------------
......
TOP = ../..
include $(TOP)/mk/boilerplate.mk
SRC_HC_OPTS=-fglasgow-exts
# Here's the argument value for the test run
SRC_RUNTEST_OPTS += 5000 +RTS -K2m -RTS
......
{-# OPTIONS -fglasgow-exts #-}
import GHC;
import PrelBase ( Int(..) );
import GlaExts;
import Complex;
import Array;
......
{-# OPTIONS -fglasgow-exts #-}
--! module Fast2haskell (
--! Complex_type(..), Array_type(..), Assoc_type(..), Descr_type(..),
--! abortstr, delay, fix, force, iff, iffrev, seq,
......@@ -6,7 +8,7 @@
--! land_i, lnot_i, lor_i, lshift_i, rshift_i,
--! descr,
--! destr_update, indassoc, lowbound, tabulate, upbound, update, valassoc) where {
import GHC;
import GlaExts;
-- import Word;
-- partain fiddle
-- type Complex_type = Complex Double;
......
TOP = ../../..
include $(TOP)/mk/boilerplate.mk
SUBDIRS= comp_lab_zift wave4main wang typecheck transform \
solid sched nucleic2 parstof listcopy listcompr ida genfft fft \
event
SRC_MKDEPENDHS_OPTS=-fglasgow-exts
include $(TOP)/mk/target.mk
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment