<commit_before>{-
Copyright (C) 2006 <NAME> <<EMAIL>>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-}

{- |
   Module     : MissingH.ProgressTracker
   Copyright  : Copyright (C) 2006 <NAME>
   License    : GNU GPL, version 2 or above

   Maintainer : <NAME> <<EMAIL>> 
   Stability  : provisional
   Portability: portable

Tools for tracking the status of a long operation.

Written by <NAME>, <EMAIL>

-}

module MissingH.ProgressTracer (
                               )

where

data ProgressInfo = 
    ProgressInfo {completedUnits :: Integer,
                  totalUnits :: Integer,
                  startTime :: Integer,
                  trackerName :: String}
    deriving (Eq, Show, Read)
<commit_msg>Work on the progress support<commit_after>{-
Copyright (C) 2006 <NAME> <<EMAIL>>

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-}

{- |
   Module     : MissingH.ProgressTracker
   Copyright  : Copyright (C) 2006 <NAME>
   License    : GNU GPL, version 2 or above

   Maintainer : <NAME> <<EMAIL>> 
   Stability  : provisional
   Portability: portable

Tools for tracking the status of a long operation.

Written by <NAME>, <EMAIL>

-}

module MissingH.ProgressTracker (ProgressRecord(..),
                               )

where
import Control.Concurrent.MVar

type ProgressTimeSource = IO Integer
type ProgressCallback = ProgressRecord -> IO ()

{- | The main progress status unit. -}
data ProgressRecord = 
     ProgressRecord {completedUnits :: Integer,
                     totalUnits :: Integer,
                     startTime :: Integer,
                     trackerName :: String,
                     timeSource :: ProgressTimeSource,
                     parents :: [Progress],
                     callbacks :: [ProgressCallback]}

type Progress = MVar ProgressRecord

-- class ProgressTypes where
--    getStatus 
{'fraction_non_alphanumeric': 0.06550500161342368, 'fraction_numerical': 0.015488867376573089, 'mean_word_length': 2.865336658354115, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '329699', 'n_tokens_mistral': 832, 'n_tokens_neox': 762, 'n_words': 372}