{-# OPTIONS_HADDOCK hide #-}moduleSystem.Console.ANSI.Unix(#include "Exports-Include.hs")whereimportSystem.Console.ANSI.CommonimportSystem.IOimportData.List#include "Common-Include.hs"-- | The reference I used for the escape characters in this module was http://en.wikipedia.org/wiki/ANSI_escape_sequencescsi::[Int]->String->Stringcsiargscode="\ESC["++concat(intersperse";"(mapshowargs))++codecolorToCode::Color->IntcolorToCodecolor=casecolorofBlack->0Red->1Green->2Yellow->3Blue->4Magenta->5Cyan->6White->7sgrToCode::SGR->IntsgrToCodesgr=casesgrofReset->0SetConsoleIntensityintensity->caseintensityofBoldIntensity->1FaintIntensity->2NormalIntensity->22SetItalicizedTrue->3SetItalicizedFalse->23SetUnderliningunderlining->caseunderliningofSingleUnderline->4DoubleUnderline->21NoUnderline->24SetBlinkSpeedblink_speed->caseblink_speedofSlowBlink->5RapidBlink->6NoBlink->25SetVisibleFalse->8SetVisibleTrue->28SetSwapForegroundBackgroundTrue->7SetSwapForegroundBackgroundFalse->27SetColorForegroundDullcolor->30+colorToCodecolorSetColorForegroundVividcolor->90+colorToCodecolorSetColorBackgroundDullcolor->40+colorToCodecolorSetColorBackgroundVividcolor->100+colorToCodecolorcursorUpCoden=csi[n]"A"cursorDownCoden=csi[n]"B"cursorForwardCoden=csi[n]"C"cursorBackwardCoden=csi[n]"D"hCursorUphn=hPutStrh$cursorUpCodenhCursorDownhn=hPutStrh$cursorDownCodenhCursorForwardhn=hPutStrh$cursorForwardCodenhCursorBackwardhn=hPutStrh$cursorBackwardCodencursorDownLineCoden=csi[n]"E"cursorUpLineCoden=csi[n]"F"hCursorDownLinehn=hPutStrh$cursorDownLineCodenhCursorUpLinehn=hPutStrh$cursorUpLineCodensetCursorColumnCoden=csi[n+1]"G"setCursorPositionCodenm=csi[n+1,m+1]"H"hSetCursorColumnhn=hPutStrh$setCursorColumnCodenhSetCursorPositionhnm=hPutStrh$setCursorPositionCodenmclearFromCursorToScreenEndCode=csi[0]"J"clearFromCursorToScreenBeginningCode=csi[1]"J"clearScreenCode=csi[2]"J"hClearFromCursorToScreenEndh=hPutStrhclearFromCursorToScreenEndCodehClearFromCursorToScreenBeginningh=hPutStrhclearFromCursorToScreenBeginningCodehClearScreenh=hPutStrhclearScreenCodeclearFromCursorToLineEndCode=csi[0]"K"clearFromCursorToLineBeginningCode=csi[1]"K"clearLineCode=csi[2]"K"hClearFromCursorToLineEndh=hPutStrhclearFromCursorToLineEndCodehClearFromCursorToLineBeginningh=hPutStrhclearFromCursorToLineBeginningCodehClearLineh=hPutStrhclearLineCodescrollPageUpCoden=csi[n]"S"scrollPageDownCoden=csi[n]"T"hScrollPageUphn=hPutStrh$scrollPageUpCodenhScrollPageDownhn=hPutStrh$scrollPageDownCodensetSGRCodesgrs=csi(mapsgrToCodesgrs)"m"hSetSGRhsgrs=hPutStrh$setSGRCodesgrshideCursorCode=csi[]"?25l"showCursorCode=csi[]"?25h"hHideCursorh=hPutStrhhideCursorCodehShowCursorh=hPutStrhshowCursorCode