Skip to content

Commit

Permalink
cleanup/formatter for most files
Browse files Browse the repository at this point in the history
  • Loading branch information
Ptival committed Aug 7, 2023
1 parent 362eb88 commit 5bda16d
Show file tree
Hide file tree
Showing 22 changed files with 1,534 additions and 1,315 deletions.
7 changes: 7 additions & 0 deletions fourmolu.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
comma-style: leading
function-arrows: trailing
haddock-style: single-line
import-export-style: diff-friendly
indentation: 2
in-style: right-align
let-style: mixed
record-brace-space: false
single-constraint-parens: never
unicode: never
18 changes: 9 additions & 9 deletions reopt-explore/Common.hs
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@

module Common where

import Control.Monad (foldM)
import Data.IORef (IORef, modifyIORef', newIORef, readIORef)
import Control.Monad (foldM)
import Data.IORef (IORef, modifyIORef', newIORef, readIORef)

import Reopt.Utils.Dir (withElfExeFilesInDir)
import Reopt.Utils.Dir (withElfExeFilesInDir)

findAllElfFilesInDirs ::
[FilePath] ->
Expand All @@ -13,8 +12,9 @@ findAllElfFilesInDirs paths = do
counter <- newIORef 1
files <- foldM (withElfExeFilesInDir (recordFile counter)) [] paths
pure $ reverse files
where recordFile :: IORef Int -> [(Int, FilePath)] -> FilePath -> IO [(Int, FilePath)]
recordFile counter ps p = do
index <- readIORef counter
modifyIORef' counter (+ 1)
pure $ (index, p):ps
where
recordFile :: IORef Int -> [(Int, FilePath)] -> FilePath -> IO [(Int, FilePath)]
recordFile counter ps p = do
index <- readIORef counter
modifyIORef' counter (+ 1)
pure $ (index, p) : ps
Loading

0 comments on commit 5bda16d

Please sign in to comment.