From 1876db50f258a1a6a67d874049e93a84d34cac32 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 21 May 2011 11:07:08 -0400 Subject: [PATCH] found a few places I can use newtype for presumably some speedups --- Backend.hs | 1 - CryptoTypes.hs | 5 +++-- Touch.hsc | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Backend.hs b/Backend.hs index ab15974c8a..645bfdfc3f 100644 --- a/Backend.hs +++ b/Backend.hs @@ -33,7 +33,6 @@ module Backend ( ) where import Control.Monad.State (liftIO, when) -import Control.Monad (liftM) import System.IO.Error (try) import System.FilePath import System.Posix.Files diff --git a/CryptoTypes.hs b/CryptoTypes.hs index 944a9d34e0..ba22c4cbe8 100644 --- a/CryptoTypes.hs +++ b/CryptoTypes.hs @@ -9,11 +9,12 @@ module CryptoTypes where import Data.String.Utils -data Cipher = Cipher String -- XXX ideally, this would be a locked memory region +-- XXX ideally, this would be a locked memory region +newtype Cipher = Cipher String data EncryptedCipher = EncryptedCipher String KeyIds -data KeyIds = KeyIds [String] +newtype KeyIds = KeyIds [String] instance Show KeyIds where show (KeyIds ks) = join "," ks diff --git a/Touch.hsc b/Touch.hsc index fd3500f869..4f26855d21 100644 --- a/Touch.hsc +++ b/Touch.hsc @@ -16,7 +16,7 @@ module Touch ( import Foreign import Foreign.C -data TimeSpec = TimeSpec CTime +newtype TimeSpec = TimeSpec CTime {- Changes the access and modification times of an existing file. Can follow symlinks, or not. Throws IO error on failure. -}