Suche senden
Hochladen
GHCソースコード読みのススメ
•
5 gefällt mir
•
1,491 views
Kiwamu Okabe
Folgen
Technologie
Melden
Teilen
Melden
Teilen
1 von 18
Jetzt herunterladen
Downloaden Sie, um offline zu lesen
Empfohlen
Meet up symfony 16 juin 2017 - Les PSR
Meet up symfony 16 juin 2017 - Les PSR
Julien Vinber
Debugging: Rules & Tools
Debugging: Rules & Tools
Ian Barber
WordPress 運用を支える Perl
WordPress 運用を支える Perl
鉄次 尾形
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
Eric Poe
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
Federico Damián Lozada Mosto
Webrtc mojo
Webrtc mojo
bpmedley
Codeigniter4の比較と検証
Codeigniter4の比較と検証
ME iBotch
Smolder @Silex
Smolder @Silex
Jeen Lee
Empfohlen
Meet up symfony 16 juin 2017 - Les PSR
Meet up symfony 16 juin 2017 - Les PSR
Julien Vinber
Debugging: Rules & Tools
Debugging: Rules & Tools
Ian Barber
WordPress 運用を支える Perl
WordPress 運用を支える Perl
鉄次 尾形
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
Eric Poe
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
Federico Damián Lozada Mosto
Webrtc mojo
Webrtc mojo
bpmedley
Codeigniter4の比較と検証
Codeigniter4の比較と検証
ME iBotch
Smolder @Silex
Smolder @Silex
Jeen Lee
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
rjsmelo
ZeroMQ Is The Answer
ZeroMQ Is The Answer
Ian Barber
2005_Structures and functions of Makefile
2005_Structures and functions of Makefile
NakCheon Jung
PHP5.5 is Here
PHP5.5 is Here
julien pauli
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heure
Amaury Bouchard
Perl web app 테스트전략
Perl web app 테스트전략
Jeen Lee
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
Zend by Rogue Wave Software
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
Advanced modulinos
Advanced modulinos
brian d foy
Future of HTTP in CakePHP
Future of HTTP in CakePHP
markstory
Bag of tricks
Bag of tricks
brian d foy
Profiling with Xhprof
Profiling with Xhprof
Tim Massey
How to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
Ian Barber
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
Ian Barber
TRunner
TRunner
Jeen Lee
C99
C99
sifo12
Отладка в GDB
Отладка в GDB
Anthony Shoumikhin
Pl python python w postgre-sql
Pl python python w postgre-sql
Piotr Pałkiewicz
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
Workhorse Computing
Spring data iii
Spring data iii
명철 강
Hadoop meetup : HUGFR Construire le cluster le plus rapide pour l'analyse des...
Hadoop meetup : HUGFR Construire le cluster le plus rapide pour l'analyse des...
Modern Data Stack France
Weitere ähnliche Inhalte
Was ist angesagt?
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
rjsmelo
ZeroMQ Is The Answer
ZeroMQ Is The Answer
Ian Barber
2005_Structures and functions of Makefile
2005_Structures and functions of Makefile
NakCheon Jung
PHP5.5 is Here
PHP5.5 is Here
julien pauli
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heure
Amaury Bouchard
Perl web app 테스트전략
Perl web app 테스트전략
Jeen Lee
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
Zend by Rogue Wave Software
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
Advanced modulinos
Advanced modulinos
brian d foy
Future of HTTP in CakePHP
Future of HTTP in CakePHP
markstory
Bag of tricks
Bag of tricks
brian d foy
Profiling with Xhprof
Profiling with Xhprof
Tim Massey
How to stand on the shoulders of giants
How to stand on the shoulders of giants
Ian Barber
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
Ian Barber
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
Ian Barber
TRunner
TRunner
Jeen Lee
C99
C99
sifo12
Отладка в GDB
Отладка в GDB
Anthony Shoumikhin
Pl python python w postgre-sql
Pl python python w postgre-sql
Piotr Pałkiewicz
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
Workhorse Computing
Was ist angesagt?
(20)
Redis & ZeroMQ: How to scale your application
Redis & ZeroMQ: How to scale your application
ZeroMQ Is The Answer
ZeroMQ Is The Answer
2005_Structures and functions of Makefile
2005_Structures and functions of Makefile
PHP5.5 is Here
PHP5.5 is Here
Créer une base NoSQL en 1 heure
Créer une base NoSQL en 1 heure
Perl web app 테스트전략
Perl web app 테스트전략
The most exciting features of PHP 7.1
The most exciting features of PHP 7.1
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
Advanced modulinos
Advanced modulinos
Future of HTTP in CakePHP
Future of HTTP in CakePHP
Bag of tricks
Bag of tricks
Profiling with Xhprof
Profiling with Xhprof
How to stand on the shoulders of giants
How to stand on the shoulders of giants
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ Is The Answer: DPC 11 Version
ZeroMQ: Messaging Made Simple
ZeroMQ: Messaging Made Simple
TRunner
TRunner
C99
C99
Отладка в GDB
Отладка в GDB
Pl python python w postgre-sql
Pl python python w postgre-sql
Ethiopian multiplication in Perl6
Ethiopian multiplication in Perl6
Ähnlich wie GHCソースコード読みのススメ
Spring data iii
Spring data iii
명철 강
Hadoop meetup : HUGFR Construire le cluster le plus rapide pour l'analyse des...
Hadoop meetup : HUGFR Construire le cluster le plus rapide pour l'analyse des...
Modern Data Stack France
Metaprogramovanie #1
Metaprogramovanie #1
Jano Suchal
Lumberjack XPath 101
Lumberjack XPath 101
Thomas Weinert
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
Ian Barber
Quick tour of PHP from inside
Quick tour of PHP from inside
julien pauli
(SDD402) Amazon ElastiCache Deep Dive | AWS re:Invent 2014
(SDD402) Amazon ElastiCache Deep Dive | AWS re:Invent 2014
Amazon Web Services
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
Night Sailer
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
Jeff Carouth
PHPSpec BDD for PHP
PHPSpec BDD for PHP
Marcello Duarte
Talkaboutlithium
Talkaboutlithium
noppoman722
Commands documentaion
Commands documentaion
TejalNijai
Rails 3 overview
Rails 3 overview
Yehuda Katz
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
Christian Trabold
Apache Hacks
Apache Hacks
Beth Skwarecki
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
ChereCheek752
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Hisateru Tanaka
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
tomcopeland
Do something in 5 with gas 2-graduate to a database
Do something in 5 with gas 2-graduate to a database
Bruce McPherson
Building Lithium Apps
Building Lithium Apps
Nate Abele
Ähnlich wie GHCソースコード読みのススメ
(20)
Spring data iii
Spring data iii
Hadoop meetup : HUGFR Construire le cluster le plus rapide pour l'analyse des...
Hadoop meetup : HUGFR Construire le cluster le plus rapide pour l'analyse des...
Metaprogramovanie #1
Metaprogramovanie #1
Lumberjack XPath 101
Lumberjack XPath 101
Debugging: Rules And Tools - PHPTek 11 Version
Debugging: Rules And Tools - PHPTek 11 Version
Quick tour of PHP from inside
Quick tour of PHP from inside
(SDD402) Amazon ElastiCache Deep Dive | AWS re:Invent 2014
(SDD402) Amazon ElastiCache Deep Dive | AWS re:Invent 2014
From mysql to MongoDB(MongoDB2011北京交流会)
From mysql to MongoDB(MongoDB2011北京交流会)
Can't Miss Features of PHP 5.3 and 5.4
Can't Miss Features of PHP 5.3 and 5.4
PHPSpec BDD for PHP
PHPSpec BDD for PHP
Talkaboutlithium
Talkaboutlithium
Commands documentaion
Commands documentaion
Rails 3 overview
Rails 3 overview
TYPO3 Extension development using new Extbase framework
TYPO3 Extension development using new Extbase framework
Apache Hacks
Apache Hacks
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
finalprojtemplatev5finalprojtemplate.gitignore# Ignore the b
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
Do something in 5 with gas 2-graduate to a database
Do something in 5 with gas 2-graduate to a database
Building Lithium Apps
Building Lithium Apps
Kürzlich hochgeladen
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
danishmna97
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Dropbox
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Zilliz
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Deepika Singh
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Andrey Devyatkin
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Edi Saputra
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
ThousandEyes
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
MadyBayot
Architecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
apidays
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Khushali Kathiriya
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Nanddeep Nachan
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
apidays
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Angeliki Cooney
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
rafiqahmad00786416
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
sammart93
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Christopher Logan Kennedy
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
Remote DBA Services
Kürzlich hochgeladen
(20)
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
Architecting Cloud Native Applications
Architecting Cloud Native Applications
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
GHCソースコード読みのススメ
1.
2.
3.
4.
5.
6.
7.
-- compiler/main/HscMain.hs hscParse'関数 hscParse'
mod_summary = do dflags <- getDynFlags let src_filename = ms_hspp_file mod_summary maybe_src_buf = ms_hspp_buf mod_summary liftIO $ showPass dflags "Parser" {-# SCC "Parser" #-} do buf <- case maybe_src_buf of Just b -> return b Nothing -> liftIO $ hGetStringBuffer src_filename let loc = mkRealSrcLoc (mkFastString src_filename) 1 1 case unP parseModule (mkPState dflags buf loc) of PFailed span err ->
8.
liftIO $ showPass
dflags "Parser" *** Parser:
9.
詳細: http://www.kotha.net/ghcguide_ja/7.0.4/ profiling.html#idp19148320
10.
liftIO $ dumpIfSet_dyn
dflags Opt_D_dump_parsed "Parser" $ ppr rdr_module ==================== Parser ============= module Queue ( Queue(..) ) where import Prelude hiding ( head, tail ) class Queue q where {
11.
hscParse' :: ModSummary
-> Hsc HsParsedModule hscParse' mod_summary = do dflags <- getDynFlags --snip-- case unP parseModule (mkPState dflags buf loc) of PFailed span err -> liftIO $ throwOneError (mkPlainErrMsg span err) POk pst rdr_module -> do logWarningsReportErrors (getMessages pst) --snip-- return HsParsedModule { hpm_module = rdr_module, hpm_src_files = srcs2 }
12.
unP parseModule (mkPState
dflags buf loc) * unP: compiler/parser/Lexer.xで定義 * parseModule: compiler/parser/Parser.y.ppで定義 * mkPState: compiler/parser/Lexer.xで定義
13.
http://www.haskell.org/alex/ http://www.haskell.org/happy/
14.
-- Parser.y.pp %monad {
P } { >>= } { return } %lexer { lexer } { L _ ITeof } %name parseModule module %name parseStmt maybe_stmt %name parseIdentifier identifier %name parseType ctype %partial parseHeader header %tokentype { (Located Token) } http://www.haskell.org/happy/doc/html/sec-monads.html
15.
16.
17.
module :: {
Located (HsModule RdrName) } : maybedocheader 'module' modid maybemodwarning maybeexports 'where' body {% fileSrcSpan >>= loc -> return (L loc (HsModule (Just $3) $5 (fst $7) (snd $7) $4 $1) )} | body2 {% fileSrcSpan >>= loc -> return (L loc (HsModule Nothing Nothing (fst $1) (snd $1) Nothing Nothing )) }
Jetzt herunterladen