울트라에디터로 Haskell 프로그래밍하기

일반적으로 많이 사용하는 프로그래머용 에디인 UltraEdit에서 Haskell 프로그래밍 하는 방법에 다루겠다.
구문 강조, 자동 완성
고급 -> 설정 -> 구문 강조 -> 단어 목록의 파일 경로 -> 열기
UltraEdit에서 언어별 구문 강조를 설정할 수 있는 wordfile.txt라는 파일이 열린다. 파일 끝에 이 페이지 아래쪽에 있는 내용을 오려 붙인다. (UltraEdit 홈페이지에서 다운 받을 수 있는 것보다 좀 더 많은 함수를 포함하고 있다.)

wordlist.txt를 저장하고, UltraEdit를 재시작하면 Haskell 파일을 구문 강조(syntax highlighting)하는 것을 볼 수 있다.
이제 Ctrl + Space를 누르면 자동 완성(auto completion) 기능도 사용할 수 있다.

GHC 연결
고급 -> 도구 설정

명령줄: C:\ghc\ghc-6.4\bin\ghc.exe --make "%f" -o "%n"
메뉴 아이템 이름: ghc MAKE
명령 결과: 결과를 캡쳐, 결과를 목록 상자로
삽입

명령줄: C:\ghc\ghc-6.4\bin\ghc.exe "%f"
메뉴 아이템 이름: ghc COMPILE
명령 결과: 결과를 캡쳐, 결과를 목록 상자로
삽입

명령줄: C:\ghc\ghc-6.4\bin\ghci.exe "%f"
메뉴 아이템 이름: ghc INTERPRET
명령 결과: 도스 창 보이기
삽입

이제 고급 메뉴를 클릭하면 맨 아래에 ghc INTERPRET, ghc COMPILE, ghc MAKE가 뜨는 것을 볼 수 있다. 소스 코드를 편집한 후 인터프리터에서 돌려보거나 컴파일 또는 링크하고 싶을 때 각각의 메뉴를 클릭하거나 단축키를 누르기만하면 된다.

파일 연결
마지막으로 .hs 파일을 더블 클릭했을 때 UltraEdit에서 열리게 하고 싶다면 다음과 같이 한다.

고급 -> 설정 -> 파일 연결

파일 종류/확장자: .hs
설명: Haskell
추가

wordlist


/L20"Haskell" Line Comment = -- Block Comment On = {- Block Comment Off = -} String Chars = "' File Extensions = HS LHS XHS
/Delimiters = (){}[];,` 	
/C1
(
)
Addr EQ EmptyRec EmptyRow Either False FilePath GT  Hugs_Error Hugs_ExitWith Hugs_Return 
Hugs_SuspendThread  IO IOError IOResult Just LT Left Maybe Nothing Ordering Rec Right Ratio 
Rational ST True  
/C2
_ = => |  <- -> ,  .. : :: class case data deriving do else import instance if in let module newtype of
primitive type then where
/C3
&& || // /= / == ! !! + ++ - * ** < <= > >> >>= >=  $ $! % . : :+ \\ ^ ^^ || abs  accum
accumArray  acos  acosh  addToClockTime  all  and  any  ap  appendFile  approxRational  array  
asin  asinh  assocs  asTypeOf  atan  atan2  atanh bounds  bracket  bracket_  break 
calendarTimeToString  catch  catMaybes  ceiling  chr  cis  compare  concat  concatMap  conjugate  
const  cos  cosh  cpuTimePrecision  createDirectory  curry  cycle decodeFloat  defaultTimeLocale  
delete  deleteBy  denominator  diffClockTimes  digitToInt  div  divMod  doesDirectoryExist  
doesFileExist  drop  dropWhile either  elem  elemIndex  elemIndices  elems  encodeFloat  
enumFrom  enumFromThen  enumFromThenTo  enumFromTo  error  even  executable  exitFailure  
exitWith  exp  exponent fail  filter  filterM  find  findIndex  findIndices  flip  floatDigits  floatRadix  
floatRange  floatToDigits  floor  fmap  foldl  foldl1  foldM  foldr  foldr1  formatCalendarTime  
fromEnum  fromInteger  fromIntegral  fromJust  fromMaybe  fromRat  fromRational  fst gcd  
genericDrop  genericIndex  genericLength  genericReplicate  genericSplitAt  genericTake  getArgs  
getChar  getClockTime getContents  getCPUTime  getCurrentDirectory  getDirectoryContents  
getEnv  getLine  getModificationTime  getPermissions  getProgName  getStdGen  getStdRandom  
group  groupBy  guard hClose  head  hFileSize  hFlush  hGetBuffering  hGetChar  hGetContents  
hGetLine  hGetPosn  hIsClosed  hIsEOF  hIsOpen  hIsReadable  hIsSeekable  hIsWritable  
hLookAhead  hPrint  hPutChar  hPutStr  hPutStrLn  hReady  hSeek  hSetBuffering  hSetPosn  
hWaitForInput id  imagPart  index  indices  init  inits  inRange  insert  insertBy  interact  intersect  
intersectBy  intersperse  intToDigit  ioeGetErrorString  ioeGetFileName  ioeGetHandle  ioError  
isAlpha  isAlphaNum  isAlreadyExistsError  isAlreadyInUseError  isAscii  isControl  isDenormalized  
isDigit  isDoesNotExistError  isEOF  isEOFError  isFullError  isHexDigit  isIEEE  isIllegalOperation  
isInfinite  isJust  isLatin1  isLower  isNaN  isNegativeZero  isNothing  isOctDigit  isPermissionError  
isPrefixOf  isPrint  isSpace  isSuffixOf  isUpper  isUserError  iterate  ixmap join last  lcm  length  lex  
lexDigits  lexLitChar  liftM  liftM2  liftM3  liftM4  liftM5  lines  listArray  listToMaybe  log  logBase  
lookup magnitude  map  mapAccumL  mapAccumR  mapAndUnzipM  mapM  mapM_  mapMaybe  
max  maxBound  maximum  maximumBy  maybe  maybeToList  min  minBound  minimum  
minimumBy  mkPolar  mkStdGen  mod  msum negate  newStdGen  next  not  notElem  nub  nubBy  
null  numerator odd  openFile  or  ord  otherwise partition  phase  pi  polar  pred  print  product  
properFraction  putChar  putStr  putStrLn quot  quotRem random  randomIO  randomR  
randomRIO  randomRs  randoms  range  rangeSize  read  readable  readDec  readFile  readFloat  
readHex  readInt  readIO  readList  readLitChar  readLn  readOct  readParen  reads  readSigned  
readsPrec  realPart  realToFrac  recip  rem  removeDirectory  removeFile  renameDirectory  
renameFile  repeat  replicate  return  reverse  round scaleFloat  scanl  scanl1  scanr  scanr1  
searchable  seq  sequence  sequence_  setCurrentDirectory  setPermissions  setStdGen  show  
showChar  showEFloat  showFFloat  showFloat  showGFloat  showInt  showList  showLitChar  
showParen  shows  showSigned  showsPrec  showString  significand  signum  sin  sinh  snd  sort  
sortBy  split  splitAt  sqrt  stderr  stdin  stdout  subtract  succ  sum  system tail  tails  take  
takeWhile  tan  tanh  toCalendarTime  toClockTime  toEnum  toInteger  toLower  toRational  
toUpper  toUTCTime  transpose  truncate  try uncurry  undefined  unfoldr  union  unionBy  unless  
unlines  until  unwords  unzip  unzip3  unzip4  unzip5  unzip6  unzip7  userError when  words  
writable  writeFile zip  zip3  zip4  zip5  zip6  zip7  zipWith  zipWith3  zipWith4  zipWith5  zipWith6  
zipWith7  zipWithM  zipWithM_ 

/C4 
Array Bool BufferMode CalendarTime Char ClockTime Complex Complex Day Double Either ExitCode 
FilePath Float Handle HandlePosn Int Integer IO IOError IOMode Maybe Month Ordering 
Permissions Ratio Rational Rational Read ReadS SeekMode Show ShowS StdGen String
TimeDiff TimeLocale
/C5
Bounded Double Enum Eq Eval Functor Fractional Floating Ix Integral Monad MonadZero MonadPlus 
Num Ord Read Real RealFrac RealFloat Show Void