⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filename.hs

📁 Haskell是一种程序语言。特别的
💻 HS
字号:
-----------------------------------------------------------------------------
-- |
-- Module      :  FileName
-- Copyright   :  Niklas R鰆emo
-- 
-- Maintainer  :  Malcolm Wallace <Malcolm.Wallace@cs.york.ac.uk>
-- Stability   :  Stable
-- Portability :  All
-- 
-- Fix up filenames for Unix/RiscOS differences.
-----------------------------------------------------------------------------

module FileName (fixFileName, fixFile) where

import Argv

fixFileName = id

-- | The command-line option -nounix is used to determine whether to
--   format a file pathname for RiscOS or unix.
fixFile :: DecodedArgs
        -> String -- ^ directory path
        -> String -- ^ filename
        -> String -- ^ extension (suffix)
        -> String
fixFile opts p file suf =
  if isUnix opts
  then (case (p,last p) of
          ("",_)  -> ""
          (_,'/') -> p
          (_,_)   -> p++"/") ++ toPath file ++ '.':suf
  else p ++ suf ++ '.':file

toPath = map (\c-> if (c=='.') then '/' else c)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -