json-autotype-3.0.1: Automatic type declaration for JSON input data

Safe HaskellSafe
LanguageHaskell2010

Data.Aeson.AutoType.Util

Contents

Description

Utility functions that may be ultimately moved to some library.

Synopsis

Documentation

withFileOrHandle :: FilePath -> IOMode -> Handle -> (Handle -> IO r) -> IO r Source #

Generic function for opening file if the filename is not empty nor "-", or using given handle otherwise (probably stdout, stderr, or stdin). TODO: Should it become utility function?

withFileOrDefaultHandle :: FilePath -> IOMode -> (Handle -> IO r) -> IO r Source #

Generic function for choosing either file with given name or stdinstdout as inputoutput. It accepts the function that takes the corresponding handle. Stdin/stdout is selected by "-".

Orphan instances

Hashable a => Hashable (Set a) Source # 
Instance details

Methods

hashWithSalt :: Int -> Set a -> Int #

hash :: Set a -> Int #